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

Subversion Repositories axi4_tlm_bfm

[/] [axi4_tlm_bfm/] [trunk/] [rtl/] [quartus-synthesis/] [user.vhdl] - Diff between revs 13 and 14

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

Rev 13 Rev 14
Line 74... Line 74...
        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';
        signal clk,reset:std_ulogic:='0';
        /* synthesis translate_on */
        /* synthesis translate_on */
 
 
 
        signal cnt:unsigned(3 downto 0);
 
        signal reset:std_ulogic:='0';
        signal testerClk:std_ulogic;
        signal testerClk:std_ulogic;
        --signal trigger:boolean;
        --signal trigger:boolean;
        signal dbg_axiTxFSM:axiBfmStatesTx;
        signal dbg_axiTxFSM:axiBfmStatesTx;
        signal anlysr_dataIn:std_logic_vector(127 downto 0);
        signal anlysr_dataIn:std_logic_vector(127 downto 0);
        signal anlysr_trigger:std_ulogic;
        signal anlysr_trigger:std_ulogic;
 
 
        /* Signal preservations for SignalTap II probing. */
 
        --attribute keep:boolean;
 
        --attribute keep of trigger:signal is true;
 
 
 
        signal axiMaster_in:t_axi4StreamTransactor_s2m;
        signal axiMaster_in:t_axi4StreamTransactor_s2m;
        signal irq_write:std_ulogic;            -- clock gating.
        signal irq_write:std_ulogic;            -- clock gating.
 
 
begin
begin
        /* Bus functional models. */
        /* Bus functional models. */
        axiMaster: entity work.axiBfmMaster(rtl)
        axiMaster: entity work.axiBfmMaster(rtl)
                port map(
                port map(
                        aclk=>irq_write, n_areset=>nReset,
                        aclk=>irq_write, n_areset=>not reset,
 
 
                        readRequest=>readRequest,       writeRequest=>writeRequest,
                        readRequest=>readRequest,       writeRequest=>writeRequest,
                        readResponse=>readResponse,     writeResponse=>writeResponse,
                        readResponse=>readResponse,     writeResponse=>writeResponse,
                        axiMaster_in=>axiMaster_in,
                        axiMaster_in=>axiMaster_in,
                        axiMaster_out=>axiMaster_out,
                        axiMaster_out=>axiMaster_out,
Line 107... Line 105...
                        outstandingTransactions=>outstandingTransactions,
                        outstandingTransactions=>outstandingTransactions,
                        dbg_axiTxFSM=>dbg_axiTxFSM
                        dbg_axiTxFSM=>dbg_axiTxFSM
        );
        );
 
 
        /* Interrupt-request generator. */
        /* Interrupt-request generator. */
        irq_write<=clk when nReset else '0';
        irq_write<=clk when not reset else '0';
 
 
        /* Simulation Tester. */
        /* Simulation Tester. */
        /* PLL to generate tester's clock. */
        /* PLL to generate tester's clock. */
        f100MHz: entity altera.pll(syn) port map(
        f100MHz: entity altera.pll(syn) port map(
                areset=>not nReset,
                areset=>'0',     --not reset,            --not nReset,
                inclk0=>clk,
                inclk0=>clk,
                c0=>testerClk,
                c0=>testerClk,
                locked=>open
                locked=>open
        );
        );
 
 
Line 130... Line 128...
        end process;
        end process;
        /* synthesis translate_on */
        /* synthesis translate_on */
 
 
 
 
        /* Hardware tester. */
        /* Hardware tester. */
        /*
        por: process(nReset,clk) is
        por: process(reset,clk) is
                --variable cnt:unsigned(7 downto 0):=(others=>'1');
                variable cnt:unsigned(7 downto 0):=x"ff";
 
        begin
        begin
                if not reset then cnt<=(others=>'1');
                if not nReset then cnt<=(others=>'1');
                elsif rising_edge(clk) then
                elsif rising_edge(clk) then
                        nReset<='1';
                        reset<='0';
 
 
                        if cnt>x"8" then nReset<='0'; end if;
                        if cnt>0 then reset<='1'; cnt<=cnt-1; end if;
 
 
                        if cnt>0 then cnt:=cnt-1; end if;
 
                end if;
                end if;
        end process por;
        end process por;
        */
 
 
 
        /* 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';
 
 
        /* Disable this for synthesis as this is not currently synthesisable.
        /* Disable this for synthesis as this is not currently synthesisable.
                Pull the framerFSM statemachine signal from lower down the hierarchy to this level instead.
                Pull the framerFSM statemachine signal from lower down the hierarchy to this level instead.
        */
        */
        /* synthesis translate_off */
        /* synthesis translate_off */
Line 160... Line 155...
        anlysr_dataIn(7 downto 0)<=std_logic_vector(symbolsPerTransfer(7 downto 0));
        anlysr_dataIn(7 downto 0)<=std_logic_vector(symbolsPerTransfer(7 downto 0));
        anlysr_dataIn(15 downto 8)<=std_logic_vector(outstandingTransactions(7 downto 0));
        anlysr_dataIn(15 downto 8)<=std_logic_vector(outstandingTransactions(7 downto 0));
        --anlysr_dataIn(2 downto 0) <= <<signal axiMaster.axiTxState:axiBfmStatesTx>>;
        --anlysr_dataIn(2 downto 0) <= <<signal axiMaster.axiTxState:axiBfmStatesTx>>;
        anlysr_dataIn(17 downto 16)<=to_std_logic_vector(dbg_axiTxFSM);
        anlysr_dataIn(17 downto 16)<=to_std_logic_vector(dbg_axiTxFSM);
        anlysr_dataIn(18)<='1' when clk else '0';
        anlysr_dataIn(18)<='1' when clk else '0';
        anlysr_dataIn(19)<='1' when nReset else '0';
        anlysr_dataIn(19)<='1' when reset else '0';
        anlysr_dataIn(20)<='1' when irq_write else '0';
        anlysr_dataIn(20)<='1' when irq_write else '0';
        anlysr_dataIn(21)<='1' when axiMaster_in.tReady else '0';
        anlysr_dataIn(21)<='1' when axiMaster_in.tReady else '0';
        anlysr_dataIn(22)<='1' when axiMaster_out.tValid else '0';
        anlysr_dataIn(22)<='1' when axiMaster_out.tValid else '0';
        anlysr_dataIn(86 downto 23)<=std_logic_vector(axiMaster_out.tData);
        anlysr_dataIn(86 downto 23)<=std_logic_vector(axiMaster_out.tData);
        anlysr_dataIn(90 downto 87)<=std_logic_vector(axiMaster_out.tStrb);
        anlysr_dataIn(90 downto 87)<=std_logic_vector(axiMaster_out.tStrb);
        anlysr_dataIn(94 downto 91)<=std_logic_vector(axiMaster_out.tKeep);
        anlysr_dataIn(94 downto 91)<=std_logic_vector(axiMaster_out.tKeep);
        anlysr_dataIn(95)<='1' when axiMaster_out.tLast else '0';
        anlysr_dataIn(95)<='1' when axiMaster_out.tLast else '0';
        anlysr_dataIn(96)<='1' when writeRequest.trigger else '0';
        anlysr_dataIn(96)<='1' when writeRequest.trigger else '0';
        anlysr_dataIn(97)<='1' when writeResponse.trigger else '0';
        anlysr_dataIn(97)<='1' when writeResponse.trigger else '0';
        --anlysr_dataIn(99 downto 98)<=to_std_logic_vector(txFSM);
        --anlysr_dataIn(99 downto 98)<=to_std_logic_vector(txFSM);
 
        anlysr_dataIn(101 downto 98)<=std_logic_vector(cnt);
 
 
        anlysr_dataIn(anlysr_dataIn'high downto 106)<=(others=>'0');
        anlysr_dataIn(anlysr_dataIn'high downto 106)<=(others=>'0');
 
 
 
 
        /* Simulate only if you have compiled Altera's simulation libraries. */
        /* Simulate only if you have compiled Altera's simulation libraries. */
Line 249... Line 245...
 
 
 
 
        /* Data transmitter. */
        /* Data transmitter. */
        sequencer_ns: process(all) is begin
        sequencer_ns: process(all) is begin
                txFSM<=i_txFSM;
                txFSM<=i_txFSM;
                if not nReset then txFSM<=idle;
                if reset then txFSM<=idle;
                else
                else
                        case i_txFSM is
                        case i_txFSM is
                                when idle=>
                                when idle=>
                                        if outstandingTransactions>0 then txFSM<=transmitting; end if;
                                        if outstandingTransactions>0 then txFSM<=transmitting; end if;
                                when transmitting=>
                                when transmitting=>
Line 264... Line 260...
                        end case;
                        end case;
                end if;
                end if;
        end process sequencer_ns;
        end process sequencer_ns;
 
 
        /* Data transmitter. */
        /* Data transmitter. */
        sequencer_op: process(nReset,irq_write) is
        sequencer_op: process(reset,irq_write) is
                /* Local procedures to map BFM signals with the package procedure. */
                /* Local procedures to map BFM signals with the package procedure. */
                procedure read(address:in t_addr) is begin
                procedure read(address:in t_addr) is begin
                        read(readRequest,address);
                        read(readRequest,address);
                end procedure read;
                end procedure read;
 
 
Line 285... Line 281...
                /* synthesis translate_off */
                /* synthesis translate_off */
                variable rv0:RandomPType;
                variable rv0:RandomPType;
                /* synthesis translate_on */
                /* synthesis translate_on */
 
 
        begin
        begin
                if not nReset then
                if reset then
                        /* synthesis only. */
                        /* synthesis only. */
                        rand0:=(others=>'0');
                        rand0:=(others=>'0');
 
 
                        /* simulation only. */
                        /* simulation only. */
                        /* synthesis translate_off */
                        /* synthesis translate_off */
Line 318... Line 314...
                end if;
                end if;
        end process sequencer_regs;
        end process sequencer_regs;
 
 
 
 
        /* Reset symbolsPerTransfer to new value (prepare for new transfer) after current transfer has been completed. */
        /* Reset symbolsPerTransfer to new value (prepare for new transfer) after current transfer has been completed. */
        process(nReset,irq_write) is
        process(reset,irq_write) is
                /* synthesis translate_off */
                /* synthesis translate_off */
                variable rv0:RandomPType;
                variable rv0:RandomPType;
                /* synthesis translate_on */
                /* synthesis translate_on */
        begin
        begin
                if not nReset then
                if reset then
                        /* synthesis translate_off */
                        /* synthesis translate_off */
                        rv0.InitSeed(rv0'instance_name);
                        rv0.InitSeed(rv0'instance_name);
                        symbolsPerTransfer<=120x"0" & rv0.RandUnsigned(8);
                        symbolsPerTransfer<=120x"0" & rv0.RandUnsigned(8);
                        report "symbols per transfer = 0x" & ieee.numeric_std.to_hstring(rv0.RandUnsigned(axiMaster_out.tData'length));
                        report "symbols per transfer = 0x" & ieee.numeric_std.to_hstring(rv0.RandUnsigned(axiMaster_out.tData'length));
                        /* synthesis translate_on */
                        /* synthesis translate_on */

powered by: WebSVN 2.1.0

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