OpenCores
URL https://opencores.org/ocsvn/axi4_tlm_bfm/axi4_tlm_bfm/trunk

Subversion Repositories axi4_tlm_bfm

[/] [axi4_tlm_bfm/] [trunk/] [tester/] [tester.vhdl] - Diff between revs 40 and 42

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 40 Rev 42
Line 46... Line 46...
 
 
--library altera; use altera.stp;
--library altera; use altera.stp;
 
 
 
 
entity tester is port(
entity tester is port(
        /* Comment-out for simulation. */
 
        clk,reset:in std_ulogic;
        clk,reset:in std_ulogic;
 
 
        /* AXI Master interface */
        /* AXI Master interface */
        axiMaster_in:buffer t_axi4StreamTransactor_s2m;
        axiMaster_in:buffer t_axi4StreamTransactor_s2m;
        axiMaster_out:in t_axi4StreamTransactor_m2s;
        axiMaster_out:in t_axi4StreamTransactor_m2s;
 
 
        /* BFM signalling. */
        /* BFM signalling. */
--      readRequest,writeRequest:t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
 
--      readResponse,writeResponse:t_bfm;
 
        readRequest,writeRequest:buffer t_bfm;
        readRequest,writeRequest:buffer t_bfm;
        readResponse,writeResponse:in t_bfm;
        readResponse,writeResponse:in t_bfm;
 
 
        irq_write:buffer std_ulogic;            -- clock gating.
        irq_write:buffer std_ulogic;            -- clock gating.
 
 
        lastTransaction:out boolean;
        lastTransaction:out boolean;
 
 
        /* Debug ports. */
        /* Debug ports. */
--      dataIn:in t_msg;
 
        selTxn:in unsigned(3 downto 0)
        selTxn:in unsigned(3 downto 0)
);
);
end entity tester;
end entity tester;
 
 
architecture rtl of tester is
architecture rtl of tester is
--      signal reset:std_ulogic:='0';
 
        signal locked:std_ulogic;
        signal locked:std_ulogic;
        signal porCnt:unsigned(3 downto 0);
        signal porCnt:unsigned(3 downto 0);
        signal trigger:boolean;
        signal trigger:boolean;
 
 
        /* Global counters. */
        /* Global counters. */
Line 89... Line 84...
        type txStates is (idle,transmitting);
        type txStates is (idle,transmitting);
        signal txFSM,i_txFSM:txStates;
        signal txFSM,i_txFSM:txStates;
 
 
        /* Tester signals. */
        /* Tester signals. */
        /* synthesis translate_off */
        /* synthesis translate_off */
--      signal clk,nReset:std_ulogic:='0';
 
        attribute period:time; attribute period of clk:signal is 10 ps;
        attribute period:time; attribute period of clk:signal is 10 ps;
        /* synthesis translate_on */
        /* synthesis translate_on */
 
 
        signal testerClk:std_ulogic;
        signal testerClk:std_ulogic;
        signal dbg_axiTxFSM:axiBfmStatesTx;
        signal dbg_axiTxFSM:axiBfmStatesTx;
Line 104... Line 98...
--      signal irq_write:std_ulogic;            -- clock gating.
--      signal irq_write:std_ulogic;            -- clock gating.
 
 
        signal prbs:t_msg;
        signal prbs:t_msg;
 
 
        /* Coverage-driven randomisation. */
        /* Coverage-driven randomisation. */
 
        /* synthesis translate_off */
        shared variable rv0:covPType;
        shared variable rv0:covPType;
 
        /* synthesis translate_on */
        signal rv:integer;
        signal rv:integer;
        signal pctCovered:real;
        signal pctCovered:real;
        signal isCovered,i_isCovered:boolean;
        signal isCovered,i_isCovered:boolean;
 
 
begin
begin
Line 120... Line 116...
        locked=>locked
        locked=>locked
    );
    );
*/
*/
        /* Interrupt-request generator. */
        /* Interrupt-request generator. */
        trigger<=txFSM/=i_txFSM or writeResponse.trigger;
        trigger<=txFSM/=i_txFSM or writeResponse.trigger;
 
--      trigger<=(txFSM/=i_txFSM and txFSM=transmitting) or writeResponse.trigger;      -- fixes bug when multiple transactions occur during endOfTx (this should be illegal).
        irq_write<=clk when not reset else '0';
        irq_write<=clk when not reset else '0';
 
 
        /* SignalTap II embedded logic analyser. Included as part of BiST architecture. */
        /* SignalTap II embedded logic analyser. Included as part of BiST architecture. */
        --anlysr_trigger<='1' when writeRequest.trigger else '0';
        --anlysr_trigger<='1' when writeRequest.trigger else '0';
        anlysr_trigger<='1' when reset else '0';
        anlysr_trigger<='1' when reset else '0';
Line 210... Line 207...
                        axiMaster_in.tReady<=true;
                        axiMaster_in.tReady<=true;
 
 
                        wait until falling_edge(clk);
                        wait until falling_edge(clk);
                        axiMaster_in.tReady<=false;
                        axiMaster_in.tReady<=false;
 
 
                        --wait until falling_edge(clk);
                        wait until falling_edge(clk);
 
 
                        report "coverage: " & to_string(pctCovered) severity note;
                        report "coverage: " & to_string(pctCovered) severity note;
                end loop;
                end loop;
                report "coverage: " & to_string(pctCovered) severity note;
                report "coverage: " & to_string(pctCovered) severity note;
                report "Completed normal read." severity note;
                report "Completed normal read." severity note;
Line 267... Line 264...
                        en=>trigger,
                        en=>trigger,
                        seed=>32x"ace1",
                        seed=>32x"ace1",
                        prbs=>prbs
                        prbs=>prbs
                );
                );
 
 
        sequencer_ns: process(all) is begin
        sequencer_ns: process(all) is
 
                variable last:boolean;
 
        begin
                txFSM<=i_txFSM;
                txFSM<=i_txFSM;
 
 
                if reset then txFSM<=idle;
                if reset then txFSM<=idle;
                else
                else
                        case i_txFSM is
                        case i_txFSM is
                                when idle=>
                                when idle=>
                                        if not lastTransaction then txFSM<=transmitting; end if;
                                        if not lastTransaction then txFSM<=transmitting; end if;
 
                                        last:=false;
                                when transmitting=>
                                when transmitting=>
                                        if axiMaster_out.tLast then
                                        --if axiMaster_out.tLast then
                                                txFSM<=idle;
                                        --      txFSM<=idle;
                                        end if;
                                        --end if;
 
 
 
                                        /* Fixes multiple transactions when axiTxState=endOfTx. Do not allow
 
                                                txFSM to enter idle until a tReady has been received after the
 
                                                last transaction.
 
                                        */
 
                                        if lastTransaction then last:=true; end if;
 
                                        if axiMaster_in.tReady and last then txFSM<=idle; end if;
                                when others=> null;
                                when others=> null;
                        end case;
                        end case;
                end if;
                end if;
        end process sequencer_ns;
        end process sequencer_ns;
 
 
Line 331... Line 339...
                                when others=>null;
                                when others=>null;
                        end case;
                        end case;
                end if;
                end if;
        end process sequencer_op;
        end process sequencer_op;
 
 
        coverageMonitor: process is
 
                procedure initialise is begin
 
                        /* simulation only. */
                        /* simulation only. */
                        /* synthesis translate_off */
                        /* synthesis translate_off */
 
        coverageMonitor: process is
 
                procedure initialise is begin
                        rv0.deallocate;                 --destroy rv0 and all bins.
                        rv0.deallocate;                 --destroy rv0 and all bins.
                        rv0.initSeed(rv0'instance_name);
                        rv0.initSeed(rv0'instance_name);
                        /* synthesis translate_on */
 
                end procedure initialise;
                end procedure initialise;
 
 
        begin
        begin
                /* Fast- and normal-reads. */
                /* Fast- and normal-reads. */
                for i in 0 to 1 loop
                for i in 0 to 1 loop
Line 370... Line 378...
                        pctCovered<=rv0.getCov;
                        pctCovered<=rv0.getCov;
                        isCovered<=rv0.isCovered;
                        isCovered<=rv0.isCovered;
                        i_isCovered<=isCovered;
                        i_isCovered<=isCovered;
                end if;
                end if;
        end process;
        end process;
 
        /* synthesis translate_on */
 
 
 
 
        sequencer_regs: process(irq_write) is begin
        sequencer_regs: process(irq_write) is begin
        if falling_edge(irq_write) then
        if falling_edge(irq_write) then
            i_txFSM<=txFSM;
            i_txFSM<=txFSM;
        end if;
        end if;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.