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

Subversion Repositories openhmc

[/] [openhmc/] [trunk/] [openHMC/] [sim/] [UVC/] [axi4_stream/] [sv/] [axi4_stream_if.sv] - Diff between revs 12 and 15

Show entire file | Details | Blame | View Log

Rev 12 Rev 15
Line 44... Line 44...
//
//
 
 
`ifndef AXI4_STREAM_IF_SV
`ifndef AXI4_STREAM_IF_SV
`define AXI4_STREAM_IF_SV
`define AXI4_STREAM_IF_SV
 
 
interface axi4_stream_if #(parameter DATA_BYTES = 16, parameter TUSER_WIDTH = 16) (
interface axi4_stream_if #(parameter DATA_BYTES = 16, parameter TUSER_WIDTH = 16) ();
        input logic ACLK,    //-- Clock (All signals sampled on the rising edge)
 
        input logic ARESET_N //-- Global Reset
 
        );
 
 
 
        //--
        //--
        //-- Interface signals
        //-- Interface signals
        //--
        //--
 
 
 
        logic ACLK;    //-- Clock (All signals sampled on the rising edge)
 
        logic ARESET_N; //-- Global Reset
 
 
        logic TVALID;   // Master valid
        logic TVALID;   // Master valid
        logic TREADY;   // Slave ready
        logic TREADY;   // Slave ready
        logic [8*DATA_BYTES-1:0] TDATA; //-- Master data
        logic [8*DATA_BYTES-1:0] TDATA; //-- Master data
        logic [TUSER_WIDTH-1:0] TUSER;  //-- Master sideband signals
        logic [TUSER_WIDTH-1:0] TUSER;  //-- Master sideband signals
 
 
Line 67... Line 67...
 
 
        logic [DATA_BYTES/16-1:0] DEBUG_VALIDS;         //-- contains the HMC-VALID Flags
        logic [DATA_BYTES/16-1:0] DEBUG_VALIDS;         //-- contains the HMC-VALID Flags
        logic [DATA_BYTES/16-1:0] DEBUG_HEADERS;        //-- contains the HMC-HEADER Flags
        logic [DATA_BYTES/16-1:0] DEBUG_HEADERS;        //-- contains the HMC-HEADER Flags
        logic [DATA_BYTES/16-1:0] DEBUG_TAILS;          //-- contains the HMC-TAIL Flags
        logic [DATA_BYTES/16-1:0] DEBUG_TAILS;          //-- contains the HMC-TAIL Flags
 
 
 
 
        //-- assigning the debug signals to TUSER
        //-- assigning the debug signals to TUSER
        assign DEBUG_VALIDS = TUSER[1*(DATA_BYTES /16)-1: (0* DATA_BYTES /16)];
        assign DEBUG_VALIDS = TUSER[1*(DATA_BYTES /16)-1: (0* DATA_BYTES /16)];
        assign DEBUG_HEADERS = TUSER[2*(DATA_BYTES /16)-1: (1* DATA_BYTES /16)];
        assign DEBUG_HEADERS = TUSER[2*(DATA_BYTES /16)-1: (1* DATA_BYTES /16)];
        assign DEBUG_TAILS = TUSER[3*(DATA_BYTES /16)-1: (2* DATA_BYTES /16)];
        assign DEBUG_TAILS = TUSER[3*(DATA_BYTES /16)-1: (2* DATA_BYTES /16)];
 
 
 
 
        //--
        //--
        //-- Interface Coverage
        //-- Interface Coverage
        //--
        //--
 
 
        covergroup axi4_cg @ (posedge ACLK);
        covergroup axi4_cg @ (posedge ACLK);
Line 164... Line 164...
        //      @(edge ACLK)
        //      @(edge ACLK)
        //      !ARESET_N |-> ARESET_N[->1];
        //      !ARESET_N |-> ARESET_N[->1];
        //
        //
        //endproperty
        //endproperty
 
 
        chk_reset_tvalid        : assert property (
        // chk_reset_tvalid     : assert property (
                //-- TVALID must be inactive during Reset
        //      //-- TVALID must be inactive during Reset
                @(posedge ACLK)
        //      @(posedge ACLK)
                !ARESET_N |-> TVALID == 1'b0
        //      !ARESET_N |-> TVALID == 1'b0
        );
        // );
 
 
 
 
        chk_valid_hold          : assert property (
        chk_valid_hold          : assert property (
                //-- if TVALID is set it must be active until TREADY
                //-- if TVALID is set it must be active until TREADY
                @(posedge ACLK) disable iff(!ARESET_N)
                @(posedge ACLK) disable iff(!ARESET_N)
Line 203... Line 203...
                @(posedge ACLK  )  disable iff (!ARESET_N)
                @(posedge ACLK  )  disable iff (!ARESET_N)
                        (TVALID &&                                              ( $countones(DEBUG_HEADERS) > $countones(DEBUG_TAILS) ))
                        (TVALID &&                                              ( $countones(DEBUG_HEADERS) > $countones(DEBUG_TAILS) ))
                        |=>     (TVALID == 1) throughout        ( $countones(DEBUG_HEADERS) < $countones(DEBUG_TAILS) )[->1]
                        |=>     (TVALID == 1) throughout        ( $countones(DEBUG_HEADERS) < $countones(DEBUG_TAILS) )[->1]
        );
        );
 
 
 
        time clk_rise;
 
        time reset_rise;
 
 
 
        always @(posedge ACLK) begin
 
                if(ARESET_N == 0)
 
                        clk_rise <= $time();
 
        end
 
 
 
        always @(posedge ARESET_N) begin
 
                reset_rise <= $time();
 
        end
 
 
 
        //TODO TODO ADD
 
        // check_sync_reset : assert property (
 
        //      @(posedge ACLK)
 
        //      $rose(ARESET_N) |=> (reset_rise == clk_rise)
 
        //      );
 
 
        property data_hold_p;
        property data_hold_p;
                //-- if TVALID is set TDATA must not be changed until TREADY
                //-- if TVALID is set TDATA must not be changed until TREADY
                logic [8*DATA_BYTES-1:0] m_data;
                logic [8*DATA_BYTES-1:0] m_data;
 
 

powered by: WebSVN 2.1.0

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