Simulation with Verilator #20
Replies: 14 comments 14 replies
-
Alternative compilation:
main.cpp should be modified too, instead of including .cpp fines, you should:
This avoids dependencies of verilator source file names and directory locations |
Beta Was this translation helpful? Give feedback.
-
I was able to simulate the vga pattern generator with verilator (note variables without double underscores __, seems converted to single ones)
Results
|
Beta Was this translation helpful? Give feedback.
-
Below is convenience class for manipulation of integer of different sizes than natives (i.e. uint6_t), based on operator overloading. Correctly handles for example automatic wrap around if the required number of bits.
|
Beta Was this translation helpful? Give feedback.
-
@suarezvictor basics for I want to also support the "extract and done" install of the oss-cad-suite tar ball releases |
Beta Was this translation helpful? Give feedback.
-
But now @suarezvictor with the oss cad suite only I am getting
I dont think the oss cad suite uses ghdl as a plugin as we have been? |
Beta Was this translation helpful? Give feedback.
-
OK I can now And get
Can you share the code for how you got vga display output? |
Beta Was this translation helpful? Give feedback.
-
Yes, let me clean it a bit. Would you help me on simulating the rsqrt
function with cxxrtl or verilator, so I can check results is same as with
the compiler? I was unable to reach that yet
El jue., 30 sep. 2021 01:16, Julian Kemmerer ***@***.***>
escribió:
… OK I can now
./src/pipelinec ./examples/arty/src/vga/test_pattern.c --sim_comb
--verilator
And get
================== Doing Verilator Simulation ================================
Compiling...
Starting simulation...
cycle 0: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 1: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 2: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 3: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 4: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 5: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 6: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 7: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 8: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
cycle 9: vga_red: 0 vga_green: 0 vga_blue: 0 vsync: 0 hsync: 0
Can you share the code for how you got vga display output?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBHVWMGYEVUBJFPFNFICXDUEPQBHANCNFSM5E6FSUZQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Do you think the std library (std08) can be skipped by using custom
functions for float processing? It seem only a few are needed
El jue., 30 sep. 2021 17:15, Julian Kemmerer ***@***.***>
escribió:
… @suarezvictor <https://github.com/suarezvictor> Very happy to help - just
trying to catch up on everything going on :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBHVWISXESQDHNGQ7GJ6RTUETAONANCNFSM5E6FSUZQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
@suarezvictor maybe we could start off even smaller? I would love to idk 'tag' the function to be verified in the PipelineC code and generate as much C++ to run tests as possible + using that bit accurate lib |
Beta Was this translation helpful? Give feedback.
-
@suarezvictor
Which has the following problems as we are aware. But more importantly - maybe you can help I dont know what command line args to give to the make command in order to include PipelineC generated C files.Ex. verilator.sh from my system
The Regarding inclusion of bit accurate types and this issue of including other files - do you have any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Note when we get around to testing more, need to specify to use the FPGA fabric 'implemented in PipelineC' version with --mult |
Beta Was this translation helpful? Give feedback.
-
I'll see the issue in detail tomorrow, but for the moment consider that the
"make" command will ignore the -I flags
What is usually done is to set an evironment variable CFLAGS=-I... -I..
(prior to calle make)
Or for C++ use the env CXXFLAGS
In regards to use bit accurate register you should just include "bitregs.h"
and it will define uintX_t for up to 64 bits
Hopefully this helps if not please wait until I can test it by myself
El jue., 30 sep. 2021 22:07, Julian Kemmerer ***@***.***>
escribió:
… Note when we get around to testing more, need to specify to use the FPGA
fabric 'implemented in PipelineC' version with --mult
./src/pipelinec ./examples/verilator/u24mult.c --mult fabric --sim_comb
--verilator --main_cpp ./examples/verilator/u24mult_main.cpp
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBHVWJUHK27C6VYBHT7ZMLUEUCT5ANCNFSM5E6FSUZQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
In regards to C compatibility and continuing what we were talking, for
connection to debug registers I suggest changing the current syntax:
result(u24mult(x(), y()));
To:
DEBUG_SET(result, u24mult(DEBUG_GET(x),DEBUG_GET(y));
With
#define DEBUG_SET(x, v) x(v)
#define DEBUG_GET(x) x()
Then when the code is compiled by a regular C compiler the macro would be
defined differently. This way C syntax is not changed (an integer variable
cannot be called as if it were a function)
El jue., 30 sep. 2021 22:31, Victor Suarez Rovere ***@***.***>
escribió:
… I'll see the issue in detail tomorrow, but for the moment consider that
the "make" command will ignore the -I flags
What is usually done is to set an evironment variable CFLAGS=-I... -I..
(prior to calle make)
Or for C++ use the env CXXFLAGS
In regards to use bit accurate register you should just include
"bitregs.h" and it will define uintX_t for up to 64 bits
Hopefully this helps if not please wait until I can test it by myself
El jue., 30 sep. 2021 22:07, Julian Kemmerer ***@***.***>
escribió:
> Note when we get around to testing more, need to specify to use the FPGA
> fabric 'implemented in PipelineC' version with --mult
> ./src/pipelinec ./examples/verilator/u24mult.c --mult fabric --sim_comb
> --verilator --main_cpp ./examples/verilator/u24mult_main.cpp
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#20 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACBHVWJUHK27C6VYBHT7ZMLUEUCT5ANCNFSM5E6FSUZQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>
|
Beta Was this translation helpful? Give feedback.
-
I was finally able to simulate the floating point function and everything works wonderfully, see #25 Hopefully you can integrate all this so the test that "PASS" can be run with simple commands. Once that done, implementing more math functions will be far simpler... I'll also appreciate we can dig into details in regards to running the optimized 24x24 fixed point multiplication, we are in a better situation with this result |
Beta Was this translation helpful? Give feedback.
-
This simulation first generates Verilog files from VHDL files, using Yosys and GHDL plugin ("write_verilog" command)
For details see: http://www.fabienm.eu/flf/convertir-du-vhdl-en-verilog-librement-avec-yosys-et-ghdl/
Commands to run for project generation & translation to verilog:
Generate .cpp files & simulator executable (see below main source for simulation)
Run simulation (first output is state before clock)
main source for simulation:
Beta Was this translation helpful? Give feedback.
All reactions