UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor fadia
Visitor
698 Views
Registered: ‎10-04-2017

Writing to IP register in simulation

Hello,

I need to design register file that is connected to an ALU in systemverilog, then simulate the top module to verify that operation are performed correctly.

I attached three modules, one for alu, register file, top module, and testbench for top module.


I am having trouble figuring out what to use for the output of the topalu module, since the output of the alu will be fed back to the write data port in register file. Once I figure this out I will figure out the issue with my test bench.

Screen Shot 2018-02-03 at 3.47.10 PM.jpg
0 Kudos
2 Replies
Moderator
Moderator
619 Views
Registered: ‎04-24-2013

Re: Writing to IP register in simulation

Hi @fadia,

 

This is what you have built, you can see the schematic by opening the elaborated design and hitting F4.

From this you should have an idea of what ports you need in your test bench.

 

ALU.PNG

 

There is no clock in your test bench so nothing will change, you need to include something equivalent to this.

 

always
    begin
        #2.5 clk = 1;
        #2.5 clk = 0;
end

 

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
0 Kudos
Visitor fadia
Visitor
598 Views
Registered: ‎10-04-2017

Re: Writing to IP register in simulation

Hi AIdan,

 

I tested the register file separately, so I have four inputs and 2 outputs as shown in the attached txt file.

if I have these conditions,

            en=1;
            A1=1;
            A2=1;
            wd=1;
            A3=1;

then the output rd1 and rd2 will be 1, but if I have

            en=1;
            A1=1;
            A2=2;
            wd=1;
            A3=1;

rd1 will be 1 and rd2 is dont care 'x'

 

I got the register file code from my book, but I didn't understand how to use A3 and WD.

0 Kudos