[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnucap-devel] verilator
From: |
Felix Salfelder |
Subject: |
Re: [Gnucap-devel] verilator |
Date: |
Sun, 12 Oct 2014 23:59:22 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Oct 12, 2014 at 12:44:52PM -0500, John Griessen wrote:
> I was thinking of compilation of verilator code separately from the digital
> filter design,
> but I suppose it would best be done with make files with filter and verilator
> for the D2A part all synchronized and compile what
> is needed decided by make.
i do not understand. what is "the digital filter design" if not the
input for verilator (written in verilog)? clearly, you may want to split
up the filter into smaller parts...
> Just treating the verilator output as recorded signals would not cover
> testing inputs to
> a digital filter well...it would depend more on human error prone steps.
yes. in order to do a full simulation (rather than feeding recorded
signals into gnucap) you will need to compile the verilator output (some
C++ code) into a gnucap component.
> A good make file that runs verilator and gnucap seems like the way. That's
> where your
> suggestion of wrapper programming for gnucap comes in, right?
makefiles are certainly a secondary issue. the wrapper programming is
about making the following steps possible at all (sorry if i was not too
clear about that):
1) create some verilog file
$ cat > something.v << EOF
module mymodule(port_a,port_b);
[..] (whatever implementation)
endmodule:
EOF
2) turn into C++ using verilator
$ verilator --some-options something.v --put-it-into something.cc
3) create object code
$ ${CXX} something.cc -fpic -c -o something.o
4) link against a wrapper (which does not exist yet)
$ ${CXX} verilator-wrapper.cc something.o -shared -o something.so
5) use this from within gnucap
$ gnucap -a ./something.so
> build
> mymodule myinstance(1 2);
> [some more netlisting]
> .
> [run simulation]
1)-4) can be made available (eventually/optionally) by means of some
additional command. then it might look like this:
$ gnucap
> attach_verilog_file_using_verilator something.v
[do 1)-4) behind the scenes]
> build
> [..] (continue as in 5))
this will still require some sort of verilator-wrapper.cc -- put
together using some internal magic, rather than manually or using
makefiles.
hope this clarifies things a bit.
cheers
felix