1
0

Initial commit

This commit is contained in:
JackCarterSmith 2025-03-07 12:02:26 +01:00
commit 8e0f728976
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
12 changed files with 101 additions and 0 deletions

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2025 jackcartersmith
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

BIN
Makefile-wip Normal file

Binary file not shown.

7
README.md Normal file
View File

@ -0,0 +1,7 @@
Usage:
1. Add sources definitions (modules and tb) in `setup_workspace.bat/sh`.
2. Run `setup_workspace.bat/sh` everytime you add new sources to the project.
3. Compile/elaborate project using `elaborate.bat/sh` when you finished code.
4. If every steps above executed successfully, you can run `run_simu.bat/sh` to generate GWD file.
5. The GWD file can be viewed using [gtkwave](https://gtkwave.sourceforge.net/) software.

9
elaborate.bat Normal file
View File

@ -0,0 +1,9 @@
@ECHO OFF
set GHDL_STD=08
set GHDL_FLAGS=-v --std=%GHDL_STD% --workdir=ghdl
set GHDL_FLAGS_IEEE=-v --std=%GHDL_STD% --workdir=ghdl --ieee=standard
ECHO Build automatically outdated files and construct design
ghdl -m %GHDL_FLAGS_IEEE% gc_d_decoder_tb
ghdl -m %GHDL_FLAGS_IEEE% -fsynopsys fifo_async_tb
ghdl -m %GHDL_FLAGS_IEEE% -fsynopsys top_tb

9
elaborate.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
GHDL_STD="08"
GHDL_FLAGS="-v --std=$GHDL_STD --workdir=ghdl"
GHDL_FLAGS_IEEE="-v --std=$GHDL_STD --workdir=ghdl --ieee=standard"
echo "Build automatically outdated files and construct design"
ghdl -m $GHDL_FLAGS_IEEE gc_d_decoder_tb
ghdl -m $GHDL_FLAGS_IEEE -fsynopsys fifo_async_tb
ghdl -m $GHDL_FLAGS_IEEE -fsynopsys top_tb

11
run_simu.bat Normal file
View File

@ -0,0 +1,11 @@
@ECHO OFF
set GHDL_STD=08
set GHDL_FLAGS=-v --std=%GHDL_STD% --workdir=ghdl
set GHDL_FLAGS_IEEE=-v --std=%GHDL_STD% --workdir=ghdl --ieee=standard
ECHO Launch simulation of all testbenchs
ghdl -r %GHDL_FLAGS_IEEE% gc_d_decoder_tb --wave=ghdl\gc_d_decoder_tb.ghw
ghdl -r %GHDL_FLAGS_IEEE% -fsynopsys fifo_async_tb --ieee-asserts=disable --wave=ghdl\fifo_async_tb.ghw
ghdl -r %GHDL_FLAGS_IEEE% -fsynopsys top_tb --ieee-asserts=disable --stop-time=7us --wave=ghdl\top_tb.ghw
REM gtkwave ghdl\top_gc_di_tb.ghw

11
run_simu.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
GHDL_STD="08"
GHDL_FLAGS="-v --std=$GHDL_STD --workdir=ghdl"
GHDL_FLAGS_IEEE="-v --std=$GHDL_STD --workdir=ghdl --ieee=standard"
echo "Launch simulation of all testbenchs"
ghdl -r $GHDL_FLAGS_IEEE gc_d_decoder_tb --wave=./ghdl/gc_d_decoder_tb.ghw
ghdl -r $GHDL_FLAGS_IEEE -fsynopsys fifo_async_tb --ieee-asserts=disable --wave=./ghdl/fifo_async_tb.ghw
ghdl -r $GHDL_FLAGS_IEEE -fsynopsys top_tb --ieee-asserts=disable --stop-time=7us --wave=./ghdl/top_tb.ghw
#gtkwave ./ghdl/top_gc_di_tb.ghw

23
setup_workspace.bat Normal file
View File

@ -0,0 +1,23 @@
@ECHO OFF
set GHDL_STD=08
set GHDL_FLAGS=-v --std=%GHDL_STD% --workdir=ghdl
set GHDL_FLAGS_IEEE=-v --std=%GHDL_STD% --workdir=ghdl --ieee=standard
RD /S /Q ghdl
MD ghdl
ghdl --clean %GHDL_FLAGS%
ECHO Import project files and build hierarchy
ghdl -i %GHDL_FLAGS% srcs\rtl\utils\cdc_bit.vhd
ghdl -i %GHDL_FLAGS% srcs\rtl\utils\cdc_ce_bit.vhd
ghdl -i %GHDL_FLAGS% srcs\rtl\utils\cdc_ce_data.vhd
ghdl -i %GHDL_FLAGS% srcs\rtl\utils\cdc_data.vhd
ghdl -i %GHDL_FLAGS% srcs\rtl\utils\cdc_r_data.vhd
ghdl -i %GHDL_FLAGS% srcs\rtl\top.vhd
ghdl -i %GHDL_FLAGS% srcs\tbs\top_tb.vhd
ECHO .
ECHO top_tb compile tree
ghdl --elab-order %GHDL_FLAGS_IEEE% -fsynopsys top_tb

22
setup_workspace.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
GHDL_STD="08"
GHDL_FLAGS="-v --std=$GHDL_STD --workdir=ghdl"
GHDL_FLAGS_IEEE="-v --std=$GHDL_STD --workdir=ghdl --ieee=standard"
rm -rf ghdl && mkdir ghdl
ghdl --clean $GHDL_FLAGS
echo "Import project files and build hierarchy"
ghdl -i $GHDL_FLAGS ./srcs/rtl/utils/cdc_bit.vhd
ghdl -i $GHDL_FLAGS ./srcs/rtl/utils/cdc_ce_bit.vhd
ghdl -i $GHDL_FLAGS ./srcs/rtl/utils/cdc_ce_data.vhd
ghdl -i $GHDL_FLAGS ./srcs/rtl/utils/cdc_data.vhd
ghdl -i $GHDL_FLAGS ./srcs/rtl/utils/cdc_r_data.vhd
ghdl -i $GHDL_FLAGS ./srcs/rtl/top.vhd
ghdl -i $GHDL_FLAGS ./srcs/tbs/top_tb.vhd
echo ""
echo "top_tb compile tree"
ghdl --elab-order $GHDL_FLAGS_IEEE -fsynopsys top_tb

0
srcs/.gitkeep Normal file
View File

0
srcs/rtl/.gitkeep Normal file
View File

0
srcs/tbs/.gitkeep Normal file
View File