Skip to content
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

The changes needed to simulate j1b with new Python3 and Verilator used in Debian/testing #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 j1b/verilator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ obj_dir/Vj1b obj_dir/Vj1b__ALL.a: $(VERILOGS) sim_main.cpp Makefile
$(MAKE) -C ..

build/lib/python/vsimj1b.so: setup.py obj_dir/Vj1b__ALL.a vsim.cpp
python setup.py install --home build
pip3 install .

clean:
rm -rf build
Expand Down
7 changes: 7 additions & 0 deletions j1b/verilator/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[project]
name = "vsimj1b"
version = "0.1.0"
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

2 changes: 1 addition & 1 deletion j1b/verilator/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Extension('vsimj1b',
['vsim.cpp'],
depends=["obj_dir/Vv3__ALL.a"],
extra_objects=["obj_dir/verilated.o", "obj_dir/Vj1b__ALL.a"],
extra_objects=["obj_dir/verilated.o", "obj_dir/verilated_threads.o", "obj_dir/Vj1b__ALL.a"],
include_dirs=["obj_dir",
"/usr/local/share/verilator/include/",
"/usr/share/verilator/include/",
Expand Down
3 changes: 2 additions & 1 deletion j1b/verilator/sim_main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include "Vj1b.h"
#include "Vj1b___024root.h"
#include "verilated_vcd_c.h"

int main(int argc, char **argv)
Expand All @@ -20,7 +21,7 @@ int main(int argc, char **argv)
fprintf(stderr, "invalid hex value at line %d\n", i + 1);
exit(1);
}
top->v__DOT__ram[i] = v;
top->rootp->v__DOT__ram[i] = v;
}

top->resetq = 0;
Expand Down
3 changes: 2 additions & 1 deletion j1b/verilator/vsim.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <assert.h>
#include "Vj1b.h"
#include "Vj1b___024root.h"
#include "verilated.h"
#define VCD 0
#if VCD
Expand Down Expand Up @@ -59,7 +60,7 @@ Vj1b_init(v3 *self, PyObject *args, PyObject *kwds)
fprintf(stderr, "invalid hex value at line %d\n", i + 1);
exit(1);
}
self->dut->v__DOT__ram[i] = v;
self->dut->rootp->v__DOT__ram[i] = v;
}

return 0;
Expand Down