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 16 and 17

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

Rev 16 Rev 17
Line 39... Line 39...
library tauhop; use tauhop.axiTransactor.all;
library tauhop; use tauhop.axiTransactor.all;
 
 
--/* TODO remove once generic packages are supported. */
--/* TODO remove once generic packages are supported. */
--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
        port(aclk,n_areset:in std_ulogic;
        port(aclk,n_areset:in std_ulogic;
                /* BFM signalling. */
                /* BFM signalling. */
                readRequest,writeRequest:in i_transactor.t_bfm:=(address=>(others=>'X'), message=>(others=>'X'), trigger=>false);
                readRequest,writeRequest:in i_transactor.t_bfm:=(address=>(others=>'X'), message=>(others=>'X'), trigger=>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.
 
 
Line 68... Line 68...
architecture rtl of axiBfmMaster is
architecture rtl of axiBfmMaster is
        /* Finite-state Machines. */
        /* Finite-state Machines. */
        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;
 
        signal i_trigger,trigger:boolean;
 
 
        /* BFM signalling. */
        /* BFM signalling. */
        signal i_readRequest,i_writeRequest:i_transactor.t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
--      signal i_readRequest,i_writeRequest:i_transactor.t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
        signal i_readResponse,i_writeResponse:i_transactor.t_bfm;
--      signal i_readResponse,i_writeResponse:i_transactor.t_bfm;
 
        signal i_writeRequest:i_transactor.t_bfm:=(address=>(others=>'X'),message=>(others=>'X'),trigger=>false);
 
        signal i_writeResponse:i_transactor.t_bfm;
 
 
begin
begin
 
        i_trigger<=writeRequest.trigger xor i_writeRequest.trigger;
 
 
        /* 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;
 
 
                if not n_areset then axiTxState<=idle;
                if not n_areset then axiTxState<=idle;
                else
                else
                        case next_axiTxState is
                        case next_axiTxState is
                                when idle=>
                                when idle=>
                                        if writeRequest.trigger xor i_writeRequest.trigger then axiTxState<=payload; end if;
                                        if i_trigger then axiTxState<=payload; end if;
                                when payload=>
                                when payload=>
                                        if outstandingTransactions<1 then axiTxState<=endOfTx; end if;
                                        if outstandingTransactions<1 then axiTxState<=endOfTx; end if;
                                when endOfTx=>
                                when endOfTx=>
                                        axiTxState<=idle;
                                        axiTxState<=idle;
                                when others=>axiTxState<=idle;
                                when others=>axiTxState<=idle;
Line 101... Line 106...
                i_axiMaster_out.tValid<=false;
                i_axiMaster_out.tValid<=false;
                i_axiMaster_out.tLast<=false;
                i_axiMaster_out.tLast<=false;
                i_axiMaster_out.tData<=(others=>'Z');
                i_axiMaster_out.tData<=(others=>'Z');
                i_writeResponse.trigger<=false;
                i_writeResponse.trigger<=false;
 
 
                if writeRequest.trigger xor i_writeRequest.trigger then
                case next_axiTxState is
 
                        when idle=>
 
                                if i_trigger then
                        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
 
                        when idle=> 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 121... Line 125...
                                if outstandingTransactions<1 then i_axiMaster_out.tLast<=true; end if;
                                if outstandingTransactions<1 then i_axiMaster_out.tLast<=true; end if;
                        when others=> null;
                        when others=> null;
                end case;
                end case;
        end process axi_bfmTx_op;
        end process axi_bfmTx_op;
 
 
        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(aclk) is begin
                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;
 
                end if;
 
        end process;
 
 
 
        process(aclk) is begin
 
                if rising_edge(aclk) then
 
                        writeResponse<=i_writeResponse;
                        writeResponse<=i_writeResponse;
 
                        axiMaster_out<=i_axiMaster_out;
 
                        trigger<=i_trigger;
                end if;
                end if;
        end process;
        end process;
 
 
end architecture rtl;
end architecture rtl;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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