Skip to content

Strongly rewritten/reordered #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5295f81
Added the hdl directory with VHDL files
rodrigomelo9 Nov 26, 2021
d31ec03
vivado: rewritten (vlog.tcl is WIP)
rodrigomelo9 Nov 26, 2021
b0a7c0b
hdl: added Verilog files (WIP)
rodrigomelo9 Nov 26, 2021
340f4f6
vivado: finished vlog.tcl
rodrigomelo9 Nov 26, 2021
24c0f56
resources: submodule updated
rodrigomelo9 Nov 26, 2021
45500a4
hdl: removed (content already in the 'resources' submodule)
rodrigomelo9 Nov 26, 2021
9c3bd98
ghdl: added a VHDL example
rodrigomelo9 Nov 26, 2021
12d3c33
resources: submodule updated
rodrigomelo9 Nov 28, 2021
82a7744
ghdl: added the check of a CHARACTER generic and a README.md file wit…
rodrigomelo9 Nov 28, 2021
ca96bbc
vivado: added the check of a CHARACTER generic and a README.md file w…
rodrigomelo9 Nov 28, 2021
39b6fbe
resources: submodule updated
rodrigomelo9 Nov 28, 2021
c4e9629
yosys: added a Verilog example
rodrigomelo9 Nov 28, 2021
a599946
vivado: fixed Verilog example after changes into resources
rodrigomelo9 Nov 28, 2021
d3cacb7
ghdl: updated README.md
rodrigomelo9 Nov 28, 2021
ef5e009
Added clean.sh
rodrigomelo9 Nov 28, 2021
bca0b5a
openflow: removed ghdl.sh and yosys.sh
rodrigomelo9 Nov 29, 2021
1aa13e0
yosys: added vhdl.sh
rodrigomelo9 Nov 29, 2021
c3da521
openflow: flow.sh was split into yosys/icestorm and yosys/trellis
rodrigomelo9 Nov 29, 2021
42e0da8
ghdl: updated the employed Docker container
rodrigomelo9 Nov 30, 2021
6c08653
yosys: updated the employed Docker container
rodrigomelo9 Nov 30, 2021
98aa5cc
ghdl: added a more concise alternative
rodrigomelo9 Dec 12, 2021
263b9c8
ghdl-yosys: added
rodrigomelo9 Dec 12, 2021
abb22a7
resources: submodule updated
rodrigomelo9 May 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "resources"]
path = resources
url = https://github.com/PyFPGA/resources
url = https://github.com/PyFPGA/resources.git
9 changes: 9 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

for DIR in */ ; do
if test -f "$DIR/Makefile"; then
make -C $DIR clean
fi
done
11 changes: 11 additions & 0 deletions ghdl-yosys/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/make

COMMAND=docker run --rm -it -v $$HOME:$$HOME -w $$PWD hdlc/ghdl:yosys bash

all: vhdl vhdl-top vlog-top

vhdl vhdl-top vlog-top:
$(COMMAND) [email protected]

clean:
rm -fr *.cf
11 changes: 11 additions & 0 deletions ghdl-yosys/vhdl-top.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

DIR=../resources/mix

yosys -Q -m ghdl -p "
ghdl $DIR/top.vhdl -e;
read_verilog $DIR/blink.v;
synth -top Top
"
18 changes: 18 additions & 0 deletions ghdl-yosys/vhdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

DIR=../resources/vhdl

FLAGS="--std=08 -fsynopsys -fexplicit -frelaxed"

GENERICS="-gBOO=true -gINT=255 -gLOG='1' -gVEC="11111111" -gCHR='Z' -gSTR="WXYZ" -gSKIP_REA=1"

ghdl -a $FLAGS --work=blink_lib $DIR/blink.vhdl
ghdl -a $FLAGS --work=blink_lib $DIR/blink_pkg.vhdl
ghdl -a $FLAGS $DIR/top.vhdl

yosys -Q -m ghdl -p "
ghdl $FLAGS $GENERICS Top ARCH_SEL;
synth -top Top
"
11 changes: 11 additions & 0 deletions ghdl-yosys/vlog-top.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

DIR=../resources/mix

yosys -Q -m ghdl -p "
ghdl $DIR/blink.vhdl -e;
read_verilog $DIR/top.v;
synth -top Top
"
9 changes: 9 additions & 0 deletions ghdl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/make

COMMAND=docker run --rm -it -v $$HOME:$$HOME -w $$PWD hdlc/ghdl:yosys bash

vhdl:
$(COMMAND) [email protected]

clean:
rm -fr *.cf
6 changes: 6 additions & 0 deletions ghdl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Notes about GHDL

> Last update: Nov 2021

* Specify a REAL generic is not supported (`unhandled override for generic "rea"`)
* As a workaround, I set SKIP_REA
40 changes: 40 additions & 0 deletions ghdl/vhdl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -e

DIR=../resources/vhdl

FLAGS="--std=08 -fsynopsys -fexplicit -frelaxed"

GENERICS="-gBOO=true -gINT=255 -gLOG='1' -gVEC="11111111" -gCHR='Z' -gSTR="WXYZ" -gSKIP_REA=1"

###############################################################################
# Alternative 1
###############################################################################

# This alternative is better to specify particular options per file

ghdl -a $FLAGS --work=blink_lib $DIR/blink.vhdl
ghdl -a $FLAGS --work=blink_lib $DIR/blink_pkg.vhdl
ghdl -a $FLAGS $DIR/top.vhdl

# --out=raw-vhdl generate a VHDL 93 netlist

ghdl synth $FLAGS --out=raw-vhdl $GENERICS Top ARCH_SEL

# This alternative creates .cf files

rm -fr *.cf

###############################################################################
# Alternative 2
###############################################################################

# This alternative is more concise

# --work=<LIBNAME> applies to the following files
# --out=verilog generate a Verilog netlist

ghdl synth $FLAGS --out=verilog $GENERICS \
--work=blink_lib $DIR/blink.vhdl $DIR/blink_pkg.vhdl \
--work=work $DIR/top.vhdl -e Top ARCH_SEL
11 changes: 0 additions & 11 deletions openflow/Makefile

This file was deleted.

57 changes: 0 additions & 57 deletions openflow/flow.sh

This file was deleted.

33 changes: 0 additions & 33 deletions openflow/ghdl.sh

This file was deleted.

54 changes: 0 additions & 54 deletions openflow/mix.sh

This file was deleted.

30 changes: 0 additions & 30 deletions openflow/yosys.sh

This file was deleted.

6 changes: 4 additions & 2 deletions vivado/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

COMMAND=vivado -mode batch -notrace -quiet -source

flow params:
all: vhdl vlog

vhdl vlog prog detect:
$(COMMAND) [email protected]

version:
echo "puts \$$tcl_version" | vivado -mode tcl -notrace -quiet

clean:
rm -fr *.bit *.cache *.hw *.runs *.xpr *.jou *.ip_user_files
rm -fr *.html *.log *.txt *.xml .Xil
rm -fr *.html *.log *.txt *.xml .Xil *.zip
17 changes: 17 additions & 0 deletions vivado/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Notes about Vivado

> Last update: Vivado 2021.2

* FREQ=125MHz to match the employed clock of the ZYBO.

VHDL:
* Support to specify a REAL generic was added/fixed in the Vivado 2020.2 version
* https://forums.xilinx.com/t5/Vivado-TCL-Community/How-to-specify-a-REAL-generic-in-Vivado/m-p/1209088#M9581
* Specify an architecture is supported, but not working
* https://support.xilinx.com/s/question/0D52E00006r9kHiSAI/specify-a-vhdl-architecture-seems-not-working
* As a workaround, I set SKIP_ARCH
* Values are specified following Verilog notation.
* In case of character, is needed to specify the ASCII value

Verilog:
* `$finish` is ignored, but fortunatly `$error("some text")` produces the desired result.
21 changes: 0 additions & 21 deletions vivado/flow.tcl

This file was deleted.

Loading