Skip to content

Commit d189829

Browse files
committed
compile and run vhdl
1 parent d1a5556 commit d189829

6 files changed

Lines changed: 354 additions & 19 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ example.exe.dSYM/
3939
example.exe
4040

4141
ipxact2systemverilog/ipxact2systemverilog.egg-info/
42+
43+
*.o
44+
tb_vhd
45+
a.out

.vscode/extensions.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"recommendations": ["esbenp.prettier-vscode", "mshr-h.veriloghdl"]
3-
}
2+
"recommendations": [
3+
"charliermarsh.ruff",
4+
"littlefoxteam.vscode-python-test-adapter",
5+
"streetsidesoftware.code-spell-checker",
6+
"eamodio.gitlens"
7+
],
8+
"unwantedRecommendations": [
9+
"ms-python.mypy-type-checker"
10+
]
11+
}

.vscode/settings.json

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,114 @@
11
{
2-
"cSpell.words": ["ipxact", "setuptools", "systemverilog", "venv", "vhdl"],
2+
"makefile.configureOnOpen": false,
3+
// Python settings
4+
"settings": {
5+
"osx": {
6+
"python.defaultInterpreterPath": "./venv/bin/python"
7+
},
8+
"linux": {
9+
"python.defaultInterpreterPath": "./venv/bin/python"
10+
},
11+
"windows": {
12+
"python.defaultInterpreterPath": ".\\venv\\Scripts\\python.exe"
13+
}
14+
},
15+
// Optional: let YOUR script handle env activation instead of the Python extension
16+
"python.terminal.activateEnvironment": false,
17+
// macOS: open zsh, source your script, then drop into a login shell
18+
"terminal.integrated.profiles.osx": {
19+
"Project (source_me)": {
20+
"path": "/bin/zsh",
21+
"args": ["-l", "-c", "source ${workspaceFolder}/source_me; exec zsh -l"],
22+
"env": {
23+
"PYTHONPATH": "${workspaceFolder}"
24+
}
25+
}
26+
},
27+
// Linux: open bash, source your script, then drop into a login shell
28+
"terminal.integrated.profiles.linux": {
29+
"Project (source_me)": {
30+
"path": "/bin/bash",
31+
"args": ["-l", "-c", "source ${workspaceFolder}/source_me; exec bash -l"],
32+
"env": {
33+
"PYTHONPATH": "${workspaceFolder}"
34+
}
35+
}
36+
},
37+
"terminal.integrated.defaultProfile.osx": "Project (source_me)",
38+
"terminal.integrated.defaultProfile.linux": "Project (source_me)",
39+
"pythonTestExplorer.testFramework": "pytest",
40+
// Pytest settings to show print output
41+
"python.testing.pytestArgs": ["-s", "-v"],
42+
"python.testing.unittestEnabled": false,
43+
"python.testing.pytestEnabled": true,
44+
// Editor settings
345
"editor.formatOnSave": true,
4-
"editor.defaultFormatter": "esbenp.prettier-vscode"
46+
"editor.detectIndentation": true,
47+
"editor.rulers": [120],
48+
"editor.tabSize": 4,
49+
// File associations
50+
"files.associations": {
51+
"*.py": "python"
52+
},
53+
// Exclude patterns
54+
"files.exclude": {
55+
"**/__pycache__": true,
56+
"**/*.pyc": true,
57+
"**/.pytest_cache": true,
58+
"**/venv": false
59+
},
60+
// Search settings
61+
"search.exclude": {
62+
"**/__pycache__": true,
63+
"**/*.pyc": true,
64+
"**/venv": true,
65+
"**/.git": true
66+
},
67+
// Ruff integration for Python
68+
"[python]": {
69+
"editor.defaultFormatter": "charliermarsh.ruff",
70+
"editor.formatOnSave": true,
71+
"editor.codeActionsOnSave": {
72+
"source.fixAll.ruff": "explicit",
73+
"source.organizeImports.ruff": "explicit"
74+
}
75+
},
76+
// Disable MyPy type checking
77+
"python.analysis.typeCheckingMode": "off",
78+
"mypy-type-checker.args": [],
79+
// Terminal settings
80+
"terminal.integrated.env.osx": {
81+
"PYTHONPATH": "${workspaceFolder}"
82+
},
83+
"terminal.integrated.env.linux": {
84+
"PYTHONPATH": "${workspaceFolder}"
85+
},
86+
"terminal.integrated.env.windows": {
87+
"PYTHONPATH": "${workspaceFolder}"
88+
},
89+
// Extensions settings
90+
"extensions.disabled": {
91+
"ms-python.mypy-type-checker": true
92+
},
93+
"cSpell.words": [
94+
"endclass",
95+
"endfunction",
96+
"endinterface",
97+
"endmodule",
98+
"endtask",
99+
"ghdl",
100+
"iverilog",
101+
"posedge",
102+
"rstn",
103+
"verilator",
104+
"Verilog",
105+
"VHDL"
106+
],
107+
// Language-specific settings
108+
"[markdown]": {
109+
"editor.wordWrap": "off"
110+
},
111+
"[json]": {
112+
"editor.defaultFormatter": "esbenp.prettier-vscode"
113+
}
5114
}

Makefile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ endif
55

66
XSD_DIR = schema1.5
77

8-
UNAME := $(shell uname)
9-
ifeq ($(UNAME), Linux)
10-
SVPARSER := ./tools/linux/depmapDebug
11-
else
12-
SVPARSER := ./tools/osx/slang-depmap
13-
endif
14-
15-
168

179
all: gen
1810

@@ -69,9 +61,9 @@ compile:
6961
vmake work > vmakefile
7062

7163
compile_ghdl:
72-
ghdl -a example/output/*.vhd example/tb/vhd_dut.vhd
73-
ghdl -e vhd_dut
74-
ghdl -r vhd_dut
64+
ghdl -a --std=08 example/output/*.vhd example/tb/*.vhd
65+
ghdl -e --std=08 tb_vhd
66+
ghdl -r --std=08 tb_vhd
7567

7668
test_c:
7769
gcc -Wall -g example/test/example.c -o example.exe
@@ -86,9 +78,6 @@ compile_verilator:
8678
compile_icarus:
8779
iverilog -g2012 -o foo example/output/*.sv
8880

89-
parse_systemverilog:
90-
$(SVPARSER) example/output/
91-
9281
.PHONY: whole_library example/output
9382

9483
sim: whole_library
@@ -104,6 +93,7 @@ indent:
10493
clean:
10594
rm -rf work transcript vsim.wlf vmakefile vsim.dbg
10695
rm -rf vhd_dut *.o *.cf
96+
rm -rf a.out tb_sim obj_dir tb_icarus_sim tb_pkg_sim tb_sv_sim
10797

10898
validate:
10999
xmllint --noout --schema ipxact2systemverilog/xml/ipxact-1.5/component.xsd example/input/test.xml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ some of the files in example/output. Instructions are for MacOsX, similiar packa
7777
available for Linux and Windows.
7878

7979
```bash
80-
brew install pandoc
80+
brew install pandoc verilator ghdl
8181

8282
# if you want to use sphinx
8383
brew install texlive

0 commit comments

Comments
 (0)