-
Notifications
You must be signed in to change notification settings - Fork 663
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
Prototyping Harness Sim Testbench #820
Comments
Update on progress: the branch Now I need to write an appropriate TestDriver.v to place the Harness in a configuration that tests the IOs of peripherals like UART and JTAG, and add a make target that calls VCS with proper arguments. I'm also thinking about a concurrent XSIM testbench that would allow users without access to a VCS license to test their FPGA prototyping harnesses. |
I'm now able to generate a VCS sim binary for an ArtyTestDriver that submodules the ArtyTestHarness. This includes all of the behavioral models for any Xilinx IP used. Here's what I did to get there: The current way that Chipyard provides behavioral models to VCS is by passing Verilog and SystemVerilog in list files with the In order to do a mixed-language simulation, all of the HDL sources need to be compiled to a VCS library, using separate vlogan and vhdlan analysis tools for Verilog and VHDL, respectively. I was able to run these commands with the right flags to compile all of the Xilinx IP, the Chipyard design, and the Chipyard sim HDL collateral to a single library. Then, I just needed to pass this library to VCS for elaboration. I found that VCS does not seem to work when by compiling only some of the sources to a VCS library, then passing remaining sources as Verilog alongside the VCS library. The sources need to be all in Verilog, or all in compiled libraries. There could be a way around this, and I will reach out to Synopsys. I did all of this by hacking some of the proprietary VCS scripts that are generated by Vivado, so I don't want to commit those. When I implement these steps in a Makefile I will commit. However, the sim binary is not building completely. When I pass it a compiled program, it complains about not understanding this as an argument. This is because VCS does not seem to be bringing in any of the C++ collateral (for things like testchip_tsi.cc that allow programs to be passed as arguments to the sim binary) via the includes that are specified in the I have the feeling that there is some issue with including C++ collateral in this way alongside compiled VCS source libraries, similar to how I could not include Verilog sources alongside compiled VCS source libraries; it had to be one or the other. When I figure this out, I should have a fully-functional Arty simulator binary, able to run the standard assembly tests. Then, I will write some loopback programs for exercising the peripherals. |
OK, I've figured out how to add System C sources to the build for the mixed-language VCS flow (Synopsys calls this the "three-step analysis UUM flow"). However, even when compiling all of the System C sources to a shared library, VCS still misses the program-as-arguent functionality specified in testchip_tsi.cc, and gives the same error as above. I've gone through the flags and am still stumped as to why this is. I reached out to Synopsys with this help ticket. It's kind of long so mostly here as reference. If anyone has an idea for why the testchip_tsi functionality is being missed in this compilation, please let me know. Otherwise, I will update with what Synopsys says.
|
Figured out why I am not able to pass the binary as an argument to the sim binary generated in this flow. This reset condition in SimSerial.v is never exited, so all of the RTL outside of the reset condition is likely pruned. This means serial_tick, which calls testchip_tsi_t, which takes argc/argvs, is not included, which is why the program is not recognized as an argument to the simulation binary. As for why we don't leave the reset condition, my suspicion is that it is related to the behavioral model for the Xilinx reset state machine that is included in the design. Will generate waveforms to see what is going on. Closing this issue, and the discussion can continue in #871. |
I haven't made as much progress on this as I'd like over the last couple weeks, so creating a feature request issue to keep it on my list and put down what I've thought about so far.
The feature request is to create simulation testbenches for FPGA harnesses that verify IO functionality. Someone submitting a PR for a new FPGA board could run these tests, or we could make it part of our CI.
It seems straightforward enough to use VCS to simulate Vivado-generated Verilog, including behavioral models provided for Xilinx IP blocks, since the .f files generated in the prototyping make flow include pointers to any Xilinx IP used.
I'll add a VCS sim with arguments and includes as a make target to
fpga/Makefile
, reusing a lot of what is already insims/vcs/Makefile
.A simple testbench wrapper around the FPGA testharness that shorts certain Tx and Rx signals would allow a loopback test for many interfaces like UART, JTAG, and SPI. Then compiled loopback test programs like this one for UART can be ran by the simulator binary, and I can write new test programs for JTAG and SPI.
Let me know if people have any feedback.
The text was updated successfully, but these errors were encountered: