Skip to content

Commit

Permalink
Merge 455b4e2 into b973865
Browse files Browse the repository at this point in the history
  • Loading branch information
rsetaluri committed Dec 18, 2018
2 parents b973865 + 455b4e2 commit 9d689dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fault/verilator_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def make_expect(self, i, action):
name = verilog_name(action.port.name)
value = action.value
if isinstance(value, actions.Peek):
value = f"top->{value.port.name}"
value = f"top->{verilog_name(value.port.name)}"
elif isinstance(action.port, m.SIntType) and value < 0:
# Handle sign extension for verilator since it expects and
# unsigned c type
Expand Down
15 changes: 15 additions & 0 deletions tests/test_verilator_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
import pytest


def test_verilator_peeks():
circ = common.TestBasicCircuit
actions = [
Poke(circ.I, 1),
Expect(circ.O, Peek(circ.O))
]
flags = ["-Wno-lint"]
with tempfile.TemporaryDirectory() as tempdir:
m.compile(f"{tempdir}/{circ.name}", circ, output="coreir-verilog")
target = fault.verilator_target.VerilatorTarget(
circ, directory=f"{tempdir}/",
flags=flags, skip_compile=True)
target.run(actions)


def test_verilator_trace():
circ = common.TestBasicClkCircuit
actions = [
Expand Down

0 comments on commit 9d689dd

Please sign in to comment.