Running verilated chiseltest outside of sbt?

61 views
Skip to first unread message

Warren Savage

unread,
Mar 28, 2023, 9:35:19 PM3/28/23
to chisel-users

Is it possible to run this outside of the sbt environment from the shell in test-run-dir?  It seems like you should, but haven't been able to figure it out so far.

It's an odd use case, but my aim is to play around with some black-boxed Verilog code outside the full Chisel environment.

Warren

Øyvind Harboe

unread,
Mar 31, 2023, 9:31:33 AM3/31/23
to chisel-users
Yes, this is possible.

You don't say much about your use-case, but you probably need to read up on the Verilator manual.

Let's say you want to:

1. Write a bit of Chisel that uses some existing Verilog code (BlackBox)
2. Write a bit of C++ code that should talk to this Verilog code
3. Then you run Verilator on the all the Verilog code you have and you write a snippet of C++ (per Verilator manual)

Now you can get an exe file that can run the Verilog code and will interact with your C++ program.

This is definitely very common thing to do with Verilator, Chisel and existing Verilog code, so although it is a bit of work, you should find it fairly straightforward.

Warren Savage

unread,
Apr 4, 2023, 1:49:07 PM4/4/23
to chisel...@googlegroups.com
Hi Øyvind,

Thanks for taking the time to respond. The use case is admittingly unusual.   I am using Chisel to create a synthesizable test bench, with black-boxed Verilog as the DUT.  The simulation is controlled via ChiselTest with the Chisel-generated test bench and the DUT being verilated.

The question was really about whether I could verilate the ChiselTest controller as well.  I suspected not, but wanted to ask the experts.

However, I do have a backup plan in that I also have a Chisel-generated test bench controller with a few simple inputs, like 'clock', 'reset', and 'start', and one output 'done'.  So I think the correct approach is to just verilate those 3 blocks of Verilog (controller, testbench, DUT) and build a little C-wrapper in the normal Verilator way.

BTW, the application for this is something I presented at a government conference last week.  In a nutshell, this thing is used to detect whether a chip has been tampered with.  The Chisel-design is loaded into a big FPGA which is wired up to the suspicious device.  The FPGA applies a gazillion vectors to the device at speed and produces a pass/fail indication at the end.

Thanks again!

Warren

--
You received this message because you are subscribed to a topic in the Google Groups "chisel-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chisel-users/fdZhPlZvy9U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/d5072519-d722-4f3b-b467-9f36f3180576n%40googlegroups.com.

Jack Koenig

unread,
Apr 4, 2023, 1:56:49 PM4/4/23
to chisel...@googlegroups.com
I apologize that it took this long for Warren's email to get through. This response was incorrectly tagged as spam (by Google's automation), and I just noticed and let it through. I've promoted Schuyler to moderator to help with this in the future.

You received this message because you are subscribed to the Google Groups "chisel-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/CADdYWZVnOn2wUfeUKkDhc1sY_96neYCWTtMqMMN0Fh52Tf9kTw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages