You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently switched my VexRiscv simulation to the official RISC-V JTAG and JTAG VPI as a network interface and was wondering why the simulation suddenly is excruciatingly slow. Turns out, that the JTAG VPI implementation has a blocking IO call in its main loop. Line 81, i.e., the readFully call is blocking. Since it's executed in a SimThread the simulation gets blocked. In practice, its not fully blocked, since a connected OpenOCD on the VPI port will send regular packages, so the simulation just becomes really slow.
A trivial fix would be to do a while loop that waits until enough bytes are present in the input buffer, the more elegant fix would probably to do some proper asynchronous IO (e.g., incremental non-blocking reading of VpiCmd packages).
The text was updated successfully, but these errors were encountered:
For the PR; let's me know when you think it isn't draft :)
I wanted to run some more tests. Played around with a network-thread (Proper thread, not SimThread), that does all the networking, parsing etc. and just passes the VpiCmds.... turns out to be a lot slower. But I'm no Java/Scala Networking Programmer, so I might just have messed it up. Anyway, let's leave it as-is.
I recently switched my VexRiscv simulation to the official RISC-V JTAG and JTAG VPI as a network interface and was wondering why the simulation suddenly is excruciatingly slow. Turns out, that the JTAG VPI implementation has a blocking IO call in its main loop. Line 81, i.e., the
readFully
call is blocking. Since it's executed in aSimThread
the simulation gets blocked. In practice, its not fully blocked, since a connected OpenOCD on the VPI port will send regular packages, so the simulation just becomes really slow.SpinalHDL/lib/src/main/scala/spinal/lib/com/jtag/sim/JtagVpi.scala
Lines 79 to 83 in 7c6b137
A trivial fix would be to do a
while
loop that waits until enough bytes are present in the input buffer, the more elegant fix would probably to do some proper asynchronous IO (e.g., incremental non-blocking reading ofVpiCmd
packages).The text was updated successfully, but these errors were encountered: