Thread: [myhdl-list] Tool to cosimulate VHDL in Vivado
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-03-11 17:27:48
|
I've written a tool to do behavioural cosimulation of synchronous VHDL code using the Vivado simulator. It's probably more accurately quasi-cosimulation as what it actually does is runs a MyHDL reference design and records all the inputs and the outputs at each clock cycle, then runs a device under test inside Vivado through the tcl interface, playing back to it the recorded inputs. The tool then returns the resultant set of outputs from both simulations for comparison. There is an equivalent tool for cosimulating myhdl models with other myhdl models, so in principle it should be a simple case of writing the test suite for myhdl development, then trivially switching the test function to use Vivado. The real win of this approach is it opens up the facility of a free simulator in order to do behavioural verification of MyHDL models of encrypted IP (most of the IP that is now shipped with Vivado). It's still necessary to have the MyHDL model, but at least the loop is now closed. I've also written a set of support functions for common things like clock generation and random input generation for use in this framework. This email is really to see if there is interest in me packaging this up and releasing it. The code is written to be solid and it has a complete test bench. I suspect that it can be easily modified to support Verilog, and I daresay much of the effort would be applicable to other simulators that are not VPI/VHPI compliant. Cheers, Henry |
From: Euripedes R. F. <roc...@gm...> - 2015-03-11 17:32:48
|
Hi Henry, even not working to much in Vivado in this moment, I would like to see and test this approach some time in future. regards 2015-03-11 14:27 GMT-03:00 Henry Gomersall <he...@ca...>: > I've written a tool to do behavioural cosimulation of synchronous VHDL > code using the Vivado simulator. > > It's probably more accurately quasi-cosimulation as what it actually > does is runs a MyHDL reference design and records all the inputs and the > outputs at each clock cycle, then runs a device under test inside Vivado > through the tcl interface, playing back to it the recorded inputs. The > tool then returns the resultant set of outputs from both simulations for > comparison. > > There is an equivalent tool for cosimulating myhdl models with other > myhdl models, so in principle it should be a simple case of writing the > test suite for myhdl development, then trivially switching the test > function to use Vivado. > > The real win of this approach is it opens up the facility of a free > simulator in order to do behavioural verification of MyHDL models of > encrypted IP (most of the IP that is now shipped with Vivado). It's > still necessary to have the MyHDL model, but at least the loop is now > closed. > > I've also written a set of support functions for common things like > clock generation and random input generation for use in this framework. > > This email is really to see if there is interest in me packaging this up > and releasing it. The code is written to be solid and it has a complete > test bench. > > I suspect that it can be easily modified to support Verilog, and I > daresay much of the effort would be applicable to other simulators that > are not VPI/VHPI compliant. > > Cheers, > > Henry > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, > sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for > all > things parallel software development, from weekly thought leadership blogs > to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > |
From: Tim B. <tim...@so...> - 2015-03-12 11:03:49
|
Hi Henry, > I've written a tool to do behavioural cosimulation of synchronous VHDL > code using the Vivado simulator. That grabbed my attention! > > It's probably more accurately quasi-cosimulation as what it actually > does is runs a MyHDL reference design and records all the inputs and the > outputs at each clock cycle, then runs a device under test inside Vivado > through the tcl interface, playing back to it the recorded inputs. The > tool then returns the resultant set of outputs from both simulations for > comparison. > > There is an equivalent tool for cosimulating myhdl models with other > myhdl models, so in principle it should be a simple case of writing the > test suite for myhdl development, then trivially switching the test > function to use Vivado. > > The real win of this approach is it opens up the facility of a free > simulator in order to do behavioural verification of MyHDL models of > encrypted IP (most of the IP that is now shipped with Vivado). It's > still necessary to have the MyHDL model, but at least the loop is now > closed. > > I've also written a set of support functions for common things like > clock generation and random input generation for use in this framework. > > This email is really to see if there is interest in me packaging this up > and releasing it. The code is written to be solid and it has a complete > test bench. I don't have access to a supported VPI/VHPI simulator, and that was one of the main stumbling blocks for me having a real go with MyHDL. I'd be very interested in this. > > I suspect that it can be easily modified to support Verilog, and I > daresay much of the effort would be applicable to other simulators that > are not VPI/VHPI compliant. > > Cheers, > > Henry > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > -- Senior Design Engineer Somerdata Ltd 1 Riverside Business Park St Annes Road Bristol BS4 4ED Tel: +44 (0)117 9634050 Fax: +44 (0)117 3302929 E-mail: tim...@so... Website: www.somerdata.com |
From: Christopher F. <chr...@gm...> - 2015-03-12 15:46:28
|
<snip> > > This email is really to see if there is interest in me packaging this up > and releasing it. The code is written to be solid and it has a complete > test bench. Yes, I think you should github it and package it up. > I suspect that it can be easily modified to support Verilog, and I > daresay much of the effort would be applicable to other simulators that > are not VPI/VHPI compliant. If I understand correctly, shouldn't this package be language agnotstic (whatever is simulated externally?). Isn't the input to the external simulated a collection of VCD(?) stimulus and capture? Regards, Chris |
From: Henry G. <he...@ca...> - 2015-03-12 16:01:46
|
On 12/03/15 15:46, Christopher Felton wrote: > <snip> >> > >> >This email is really to see if there is interest in me packaging this up >> >and releasing it. The code is written to be solid and it has a complete >> >test bench. > Yes, I think you should github it and package it > up. > >> >I suspect that it can be easily modified to support Verilog, and I >> >daresay much of the effort would be applicable to other simulators that >> >are not VPI/VHPI compliant. > If I understand correctly, shouldn't this package > be language agnotstic (whatever is simulated > externally?). Isn't the input to the external > simulated a collection of VCD(?) stimulus and > capture? Not currently, though having found out properly about VCD files today, perhaps that would have been a better idea*. The implementation is a generator from a LUT with a VHDL file writer (essentially implementing my own synchronous signal output file). This makes it VHDL specific, but it would be simple to write the equivalent for Verilog. It's not complicated, but it does work. I'll stick it on github so you can critique it properly. Give me an hour or so... Cheers, Henry *It's really frustrating to find this, which I did by stumbling across the relevant tcl commands for Vivado - it's not like I didn't make a concerted effort to work out the standard way of reading/writing signals from a simulator. That said, I still can't work out whether there is any way to read from a VCD file in the simulation. The FPGA world is very hard to penetrate. |
From: Henry G. <he...@ca...> - 2015-03-13 20:34:09
|
On 11/03/15 17:27, Henry Gomersall wrote: > I've written a tool to do behavioural cosimulation of synchronous VHDL > code using the Vivado simulator. This is now published at: https://github.com/hgomersall/Veriutils It took a while longer than expected to get Interfaces working (and even then, only to one level) - there is a bug in the conversion whereby signals are missed if they're only used in a vhdl_code block. Enum signals are not currently supported. Please liberally submit pull requests! (with tests :) It's not currently packaged as I need to go and eat my dinner. Hopefully I'll get around to it soon. Cheers, Henry |
From: Henry G. <he...@ca...> - 2015-03-13 20:37:16
|
On 13/03/15 20:34, Henry Gomersall wrote: > On 11/03/15 17:27, Henry Gomersall wrote: > Enum signals are not currently supported. To be clear, they're only not supported with the Vivado cosim bit. They work in the rest of the code, including the myhdl cosimulation. Cheers, Henry |
From: Henry G. <he...@ca...> - 2015-03-15 19:30:46
|
On 13/03/15 20:34, Henry Gomersall wrote: > On 11/03/15 17:27, Henry Gomersall wrote: >> >I've written a tool to do behavioural cosimulation of synchronous VHDL >> >code using the Vivado simulator. > This is now published at: > > https://github.com/hgomersall/Veriutils It now works pretty well with a load of improvements and an example that uses some encrypted IP. Vivado is very very slow, but all the test cases work nicely. Cheers, Henry |