How to use the same AxiManager in two different processes to access AXI4 slave
Why OSVVM™? › Forums › OSVVM › How to use the same AxiManager in two different processes to access AXI4 slave
Tagged: communication, osvvm, VUnit
- This topic has 7 replies, 2 voices, and was last updated 6 days, 9 hours ago by
Jim Lewis.
-
AuthorPosts
-
March 7, 2025 at 15:26 #2645
Alex
MemberI have been using VUNIT for a while now and now exploring the benefits of OSVVM VCs. I have a VUNIT testbench where I access an AXI4Lite Slave from two processes with the same OSVVM AXI4LiteManager AddressBusRecType. When I tried this I stumbled upon the Multiple Driver Detection error. From looking at the TbAxi4_ReleaseAcquireManager1.vhd example, I think its possible using the Synchronization (WaitforBarrier) techniques to access the slave using the same AddressBusRecType from two different processes. Is this possible ? Is this the right way to approach it?
VUNIT provides the COM library which has the network_t handle which simplifies the communication easily between two processes. Is there a way in OSVVM to handle this? Below is an example snippet on what I am trying to do:
ref_rx_process : process is variable cnt : integer := 0; ..... begin rx_cnt_s <= 0; loop-- wait for RX ack wait until (irq_rx = '1'); Read(Axi4MemRec, X"80", rd_data); if (rd_data(10) = '1') then Write(Axi4MemRec, x"20", x"0000500"); Read(Axi4MemRec, x"920", rd_data); .... ... end if; end loop; end process; main: process is variable rv : RandomPType; constant log_file_name: string := output_path(runner_cfg) & "/logger.log"; variable file_handler: log_handler_t; variable file_logger, both_logger: logger_t; ..... begin test_runner_setup(runner, runner_cfg); osvvm.TbUtilPkg.WaitForLevel(reset, '0'); osvvm.TbUtilPkg.WaitForClock(clk, 2000); -- init phase rv.InitSeed(rv'instance_name); sb_check <= 0; while test_suite loop -- ========================================================= -- Test configuration -- ========================================================= if run("") then ... elsif run("") then ... elsif run("") then ... end if; -- ========================================================== -- Test execution -- ========================================================== -- setup device wait for 1 ms; loop if max= '1' then .... Read(Axi4MemRec, std_logic_vector(to_unsigned(2304,32)), rd_data); ..... Write(Axi4MemRec, X"080", w0); Write(Axi4MemRec, X"084", w1); ..... if x = Y then Write(Axi4MemRec, X"086", x"00000000"); Write(Axi4MemRec, X"086", x"11223344"); Write(Axi4MemRec, X"096", x"55667788"); else Write(Axi4MemRec, X"088", x"11223344"); Write(Axi4MemRec, X"08c", x"55667788"); end if; end if; wait for 0.02 ms; -- 20us end loop; .... wait for 10.0 ms; -- =================================================================================================================================================================== -- Reporting -- =================================================================================================================================================================== ..... osvvm.TbUtilPkg.WaitForClock(clk, 1000); end loop; test_runner_cleanup(runner); end process;
March 7, 2025 at 21:00 #2646Jim Lewis
MemberCan you describe what you are doing.
While you can release the record there are other approaches.
For interrupt handling, OSVVM has an interrupt handler. See the common (MIT) repository in OsvvmLibraries.
You can also directly access OSVVM memories – no transaction record required
Out teaching OSVVM this week so it is harder to give exact file references
March 9, 2025 at 20:21 #2647Alex
MemberI use the Axi4Lite Manager as a master to access an AXI slave in the DUT. I need a solution to access the AXI slave from both the processes whcih I an currently not able to because of the multiple detect error. The AXI slave does have a memory as well as register map for configuration. And the interrupt comes from the slave indicating an arriving data. While I try to access the slave from both the processes in parallel, I am facing this issue.
March 9, 2025 at 20:34 #2648Jim Lewis
MemberOSVVM supports 2 processes for interrupt handling. See https://github.com/OSVVM/Documentation/blob/main/InterruptHandler_user_guide.pdf for details.
It uses 2 separate records. Control flow automatically switches to the interrupt handling process when an interrupt is pending. As described in the user guide it requires a specific interrupt handler to manage the separate streams
March 12, 2025 at 10:24 #2650Alex
MemberThanks Jim, that helped. Now I have a running VUNIT testbench with the AXI4Lite VC. I would like to further extend this with the reporting features. I did browse through the scripting docu and the examples about the reporting. I am able to generate the YAML files. But the HTML reports are missing. Since I run a VUNIT testbench is there anything that I need to manually do to get the HTML reports? I did run the Startup.tcl with QuestaSim.
My aim is to profit from the extensive OSVVM VCs and logging/reporting/ coverage features by integrating with the VUNIT framework I already have.
March 14, 2025 at 01:23 #2654Jim Lewis
MemberHi Alex,
What is your motivating factor to use VUnit? Is there some capability there that you would like to see in OSVVM? Are you just using VUnit as a test runner or are you also using some of the VHDL code that is part of VUnit?Currently OSVVM HTML reports are collaboration of OSVVM scripting and OSVVM VHDL code. The Test Case reports are created by both scripts and VHDL code – and then the HTML code for these is created when a simulation finishes. The Build report is written to by both the scripts and VHDL, and then when the build finishes (many simulations), the build report is created. So it is not a simple task to port this to VUnit.
There is some work being done by Patrick Lehmann under the https://github.com/edaa-org that is working toward some of this, but it is still out a little – and it is going to need to evolve with us as we have some future changes to the reporting that hopefully will be happening later this year.
Best Regards,
JimMarch 14, 2025 at 14:57 #2655Alex
MemberThanks for the insight.
VUnit is an exisiting framework which is part of the current CI pipeline setup I use. Currently most of the testbenches use VUNIT HDL as well as the automation test runner features for CI.
As mentioned, looking to benefit from the OSVVM features especially VCs, functional coverage and reporting to enable a comprehensive verification approach. P.S. Just a week old to OSVVM and still exploring.
Is there a possibilty to use any of the Modelsim/Questa simulator features for the OSVVM functional coverage reporting?
March 25, 2025 at 13:38 #2657Jim Lewis
Member> Is there a possibilty to use any of the Modelsim/Questa simulator features for the OSVVM functional coverage reporting?
Not at this time. We looked at exporting an XML to UCIS, but they do not support the UCIS standard in this area. There is a C interface, but UCIS is based on crossing existing item/point coverage models using to create a cross and it primarily supports pure cartesian crosses. OSVVM uses an additive method to creating cross coverage (since we are doing it during simulation time). This does not map into UCIS all that well.
-
AuthorPosts
- You must be logged in to reply to this topic.