Video simulator #22
suarezvictor
started this conversation in
Show and tell
Replies: 2 comments
-
Wow an excellent example - cant wait to try it out! Thinking perhaps the user could specify to the PipelineC tool an existing main.cpp to use (i.e. the one you just posted) instead of just generating a 10 cycle template main.cpp |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think a default "simulation.cpp" on same director y as .c to process file
will be ok
El jue., 30 sep. 2021 17:07, Julian Kemmerer ***@***.***>
escribió:
… Wow an excellent example - cant wait to try it out!
Thinking perhaps the user could specify to the PipelineC tool an existing
main.cpp to use (i.e. the one you just posted) instead of just generating a
10 cycle template main.cpp
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBHVWKAL4S34CTN7HDMNJ3UES7RBANCNFSM5FCWVFDQ>
.
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the source for the video simulator I announced on twitter: https://twitter.com/suarezvictor/status/1443288849468231692
For compiling original pattern generator test_pattern.c as is (and show it on screen when USE_VERILATOR macro not defined) small changes are needed to get full C and PipelineC compatibility (see #10 ). All referenced headers of PipelineC not found could be left empty, except the new "bitregs.h" that was posted on #20, which defines uintN_t and operations on such.
The no verilator version achieves about 33 FPS for 640x480 (44 with the hack for using native sizes for integers regardless asking for smaller sizes). For the verilated version, I wasn't able to test on less than 1920x1080 as cause of the current GHDL memory errors. At such high resolution it runs at about 4 FPS. Based on this, a cycle-to-cycle comparison can be done as explained in #21, or a switch between versions at the press of a key.
There's an algorithm to automatically detect horizontal/vertical blanking periods that may be avoided if the "active" signal is exported. Maybe this algorithm can be optimized, or also run a first frame to determine resolution before window creation.
Command to run is: clang++ -O3 -I. -I/usr/share/verilator/include main.cpp -o vtop -lSDL2
Alternatively, g++ also works. If using verilator-generated makefiles, it needs some way of passing "-lSDL2" linker command and changes for replacing the #includes for .cpp files to the corresponding headers.
Beta Was this translation helpful? Give feedback.
All reactions