Hello,
Still dinking around with PyMTL and am baffled by a little ECE 5745 example.
I'm trying to test /my/path/regincr/RegIncrNstageVRTL.v (a 2-stage registered incrementer in my case) which has the line
`include "RegIncrVRTL.v"
So I also have the file /my/path/regincr/RegIncrVRTL.v
But whey I run my PyMTL code I get the error:
E FileNotFoundError: [Errno 2] No such file or directory: '/my/path/regincr/regincr/RegIncrVRTL.v'
When I create the file /my/path/regincr/regincr/RegIncrVRTL.v, the problem goes away and the test executes fine.
In fact, even when I entirely remove the `include line above from RegIncrVRTL.v, the test still executes fine (as long as /my/path/regincr/regincr/RegIncrVRTL.v is present of course).
It **seems** like PyMTL has some way of finding the dependency, but only if the module is placed in an appropriately named subfolder. Am I goofing somehow with my PyMTL code (examples below sign-off)?
Thanks, Sebastian
PyMTL Design Code (
from pymtl3 import *
from pymtl3.passes.backends.verilog import VerilogPlaceholderPass, VerilogPlaceholder
from os.path import dirname
class RegIncrNstageVRTL( Component, VerilogPlaceholder ):
def construct( s, nstages=2 ):
s.in_ = InPort ( Bits8 )
s.out = OutPort ( Bits8 )
s.set_metadata(VerilogPlaceholderPass.src_file, dirname(__file__) + '/RegIncrNstageVRTL.v')
s.set_metadata(VerilogPlaceholderPass.top_module, 'RegIncrNstageVRTL')
RegIncrNstageRTL = RegIncrNstageVRTL
PyMTL Test Code
from pymtl3.stdlib.test_utils import run_test_vector_sim, mk_test_case_table
from .RegIncrNstageRTL import RegIncrNstageRTL
def test_small( cmdline_opts ):
run_test_vector_sim( RegIncrNstageRTL(), [
('in_ out*'),
[ 0x00, '?' ],
[ 0x03, '?' ],
[ 0x06, '?' ],
[ 0x00, 0x05 ],
], cmdline_opts )