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

Subversion Repositories axi4_tlm_bfm

[/] [axi4_tlm_bfm/] [trunk/] [rtl/] [axi4-stream-bfm-master.vhdl] - Diff between revs 13 and 15

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

Rev 13 Rev 15
Line 42... Line 42...
--library tauhop; use tauhop.tlm.all, tauhop.axiTLM.all;
--library tauhop; use tauhop.tlm.all, tauhop.axiTLM.all;
 
 
entity axiBfmMaster is --generic(constant maxTransactions:positive);
entity axiBfmMaster is --generic(constant maxTransactions:positive);
        port(aclk,n_areset:in std_ulogic;
        port(aclk,n_areset:in std_ulogic;
                /* BFM signalling. */
                /* BFM signalling. */
                /* FIXME Generic package defect. ModelSim currently can't make tauhop.axiTransactor.i_transactor visible. */
                readRequest,writeRequest:in i_transactor.t_bfm:=(address=>(others=>'X'), message=>(others=>'X'), trigger=>false);
                readRequest,writeRequest:in i_transactor.t_bfm:=((others=>'X'),(others=>'X'),false);
 
                --readRequest,writeRequest:in i_transactor.t_bfm:=((others=>'X'),(others=>'X'),false);
 
                readResponse,writeResponse:buffer i_transactor.t_bfm;                                                                   -- use buffer until synthesis tools support reading from out ports.
                readResponse,writeResponse:buffer i_transactor.t_bfm;                                                                   -- use buffer until synthesis tools support reading from out ports.
 
 
                /* AXI Master interface */
                /* AXI Master interface */
                axiMaster_in:in t_axi4StreamTransactor_s2m;
                axiMaster_in:in t_axi4StreamTransactor_s2m;
                axiMaster_out:buffer t_axi4StreamTransactor_m2s;
                axiMaster_out:buffer t_axi4StreamTransactor_m2s;
Line 72... Line 70...
        signal axiTxState,next_axiTxState:axiBfmStatesTx:=idle;
        signal axiTxState,next_axiTxState:axiBfmStatesTx:=idle;
 
 
        signal i_axiMaster_out:t_axi4StreamTransactor_m2s;
        signal i_axiMaster_out:t_axi4StreamTransactor_m2s;
 
 
        /* BFM signalling. */
        /* BFM signalling. */
        signal i_readRequest:i_transactor.t_bfm:=((others=>'0'),(others=>'0'),false);
        signal i_readRequest,i_writeRequest:i_transactor.t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
        signal i_writeRequest:i_transactor.t_bfm:=((others=>'0'),(others=>'0'),false);
 
 
 
        signal i_readResponse,i_writeResponse:i_transactor.t_bfm;
        signal i_readResponse,i_writeResponse:i_transactor.t_bfm;
 
 
begin
begin
        /* Transaction counter. */
        /* Transaction counter. */
        process(n_areset,symbolsPerTransfer,aclk) is begin
        process(n_areset,symbolsPerTransfer,aclk) is begin
Line 88... Line 84...
                                outstandingTransactions<=symbolsPerTransfer;
                                outstandingTransactions<=symbolsPerTransfer;
                                report "No more pending transactions." severity note;
                                report "No more pending transactions." severity note;
                        elsif axiMaster_in.tReady then outstandingTransactions<=outstandingTransactions-1;
                        elsif axiMaster_in.tReady then outstandingTransactions<=outstandingTransactions-1;
                        end if;
                        end if;
                end if;
                end if;
 
 
                /* debug only. */
 
                /*if falling_edge(aclk) then
 
                        if not n_areset then outstandingTransactions<=symbolsPerTransfer;
 
                        else
 
                                if outstandingTransactions<1 then
 
                                        outstandingTransactions<=symbolsPerTransfer;
 
                                        report "No more pending transactions." severity note;
 
                                elsif axiMaster_in.tReady then outstandingTransactions<=outstandingTransactions-1;
 
                                end if;
 
                        end if;
 
                end if;
 
                */
 
        end process;
        end process;
 
 
        /* next-state logic for AXI4-Stream Master Tx BFM. */
        /* next-state logic for AXI4-Stream Master Tx BFM. */
        axi_bfmTx_ns: process(all) is begin
        axi_bfmTx_ns: process(all) is begin
                axiTxState<=next_axiTxState;
                axiTxState<=next_axiTxState;
Line 136... Line 119...
                        i_axiMaster_out.tData<=writeRequest.message;
                        i_axiMaster_out.tData<=writeRequest.message;
                        i_axiMaster_out.tValid<=true;
                        i_axiMaster_out.tValid<=true;
                end if;
                end if;
 
 
                case next_axiTxState is
                case next_axiTxState is
                        when idle=>
                        when idle=> null;
                        /*      if writeRequest.trigger xor i_writeRequest.trigger then
 
                                        i_axiMaster_out.tData<=writeRequest.message;
 
                                        i_axiMaster_out.tValid<=true;
 
                                end if;
 
                        */
 
                                null;
 
                        when payload=>
                        when payload=>
                                i_axiMaster_out.tData<=writeRequest.message;
                                i_axiMaster_out.tData<=writeRequest.message;
                                i_axiMaster_out.tValid<=true;
                                i_axiMaster_out.tValid<=true;
 
 
                                if axiMaster_in.tReady then
                                if axiMaster_in.tReady then
Line 161... Line 138...
 
 
        axiMaster_out<=i_axiMaster_out;
        axiMaster_out<=i_axiMaster_out;
 
 
        /* state registers and pipelines for AXI4-Stream Tx BFM. */
        /* state registers and pipelines for AXI4-Stream Tx BFM. */
        process(n_areset,aclk) is begin
        process(n_areset,aclk) is begin
                --if not n_areset then next_axiTxState<=idle;
 
                if falling_edge(aclk) then
                if falling_edge(aclk) then
                        next_axiTxState<=axiTxState;
                        next_axiTxState<=axiTxState;
                        i_writeRequest<=writeRequest;
                        i_writeRequest<=writeRequest;
                        --axiMaster_out<=i_axiMaster_out;
                        --axiMaster_out<=i_axiMaster_out;
                end if;
                end if;

powered by: WebSVN 2.1.0

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