Reorganization of files
This commit is contained in:
6
Makefile
6
Makefile
@@ -18,8 +18,8 @@ CPP_BUILD_LOG=logs/$(PROJ)_build_cpp.log
|
||||
|
||||
SIM_LOG=$(PROJ)_sim.log
|
||||
|
||||
SV_FILES=$(shell ls common/* src/*.sv tb/*.sv)
|
||||
SV_SRC=$(UVM_HOME)/src/uvm_pkg.sv common/common_pkg.sv src/design_pkg.sv tb/tb_types.sv tb/tb_pkg.sv
|
||||
SV_FILES=$(shell ls common/*.sv src/axi/*.sv tb/*.sv)
|
||||
SV_SRC=$(UVM_HOME)/src/uvm_pkg.sv common/common_pkg.sv src/axi/axi_types.sv src/axi/axi_pkg.sv tb/tb_pkg.sv
|
||||
DPI_SRC=$(UVM_HOME)/src/dpi/uvm_dpi.cc
|
||||
DPI_INC=-I/usr/share/verilator/include
|
||||
SV_DEPS=$(SV_FILES)
|
||||
@@ -44,7 +44,7 @@ BUILD_ARGS=-I$(UVM_HOME)/src -I. \
|
||||
+define+SVA_ON \
|
||||
$(UVM_DEFINES) \
|
||||
$(DISABLED_WARNINGS) \
|
||||
+incdir+common +incdir+src +incdir+tb \
|
||||
+incdir+common +incdir+src/axi +incdir+tb \
|
||||
$(SV_SRC)
|
||||
|
||||
ifndef TEST_NAME
|
||||
|
8
common/common_macros.svh
Normal file
8
common/common_macros.svh
Normal file
@@ -0,0 +1,8 @@
|
||||
// Convenience macros for AXI interfaces
|
||||
`define AXI_INTF axi_intf #(.ADDR_WIDTH(`ADDR_WIDTH), \
|
||||
.CEIL_DATA_WIDTH_DIV_128(`CEIL_DATA_WIDTH_DIV_128), \
|
||||
.CEIL_DATA_WIDTH_DIV_128_TMS_4(`CEIL_DATA_WIDTH_DIV_128_TMS_4), \
|
||||
.CEIL_DATA_WIDTH_DIV_64(`CEIL_DATA_WIDTH_DIV_64), \
|
||||
.DATA_WIDTH(`DATA_WIDTH), \
|
||||
.DATA_WIDTH_DIV_8(`DATA_WIDTH_DIV_8))
|
||||
|
@@ -29,11 +29,3 @@
|
||||
// `define USER_DATA_WIDTH 1
|
||||
// `define USER_REQ_WIDTH 1
|
||||
// `define USER_RESP_WIDTH 1
|
||||
|
||||
// Defines
|
||||
`define AXI_INTF axi_intf #(.ADDR_WIDTH(`ADDR_WIDTH), \
|
||||
.CEIL_DATA_WIDTH_DIV_128(`CEIL_DATA_WIDTH_DIV_128), \
|
||||
.CEIL_DATA_WIDTH_DIV_128_TMS_4(`CEIL_DATA_WIDTH_DIV_128_TMS_4), \
|
||||
.CEIL_DATA_WIDTH_DIV_64(`CEIL_DATA_WIDTH_DIV_64), \
|
||||
.DATA_WIDTH(`DATA_WIDTH), \
|
||||
.DATA_WIDTH_DIV_8(`DATA_WIDTH_DIV_8))
|
@@ -1,3 +1,5 @@
|
||||
`include "axi.intf.sv"
|
||||
`include "common_params.svh"
|
||||
`include "common_macros.svh"
|
||||
package common_pkg;
|
||||
endpackage
|
||||
|
@@ -5,7 +5,7 @@
|
||||
typedef axi_sequencer;
|
||||
|
||||
class axi_agent extends uvm_agent;
|
||||
agent_type_t agent_type;
|
||||
axi_agent_type_t agent_type;
|
||||
virtual `AXI_INTF.MANAGER m_if;
|
||||
virtual `AXI_INTF.SUBORDINATE s_if;
|
||||
|
||||
@@ -15,7 +15,7 @@ class axi_agent extends uvm_agent;
|
||||
axi_monitor monitor;
|
||||
|
||||
`uvm_component_utils_begin(axi_agent)
|
||||
`uvm_field_enum(agent_type_t, agent_type, UVM_DEFAULT)
|
||||
`uvm_field_enum(axi_agent_type_t, agent_type, UVM_DEFAULT)
|
||||
`uvm_component_utils_end
|
||||
|
||||
// --------------------------------------------------
|
||||
@@ -26,7 +26,7 @@ class axi_agent extends uvm_agent;
|
||||
|
||||
// --------------------------------------------------
|
||||
// Set agent type
|
||||
function void set_agent_type(agent_type_t atype);
|
||||
function void set_agent_type(axi_agent_type_t atype);
|
||||
agent_type = atype;
|
||||
`uvm_info("set_agent_type", $sformatf("Agent type set to %s", agent_type.name()), UVM_LOW)
|
||||
endfunction
|
@@ -4,7 +4,7 @@
|
||||
class axi_driver extends uvm_driver; // #(axi_transaction);
|
||||
virtual `AXI_INTF.MANAGER m_if;
|
||||
virtual `AXI_INTF.SUBORDINATE s_if;
|
||||
agent_type_t agent_type;
|
||||
axi_agent_type_t agent_type;
|
||||
|
||||
`uvm_component_utils(axi_driver)
|
||||
|
||||
@@ -16,7 +16,7 @@ class axi_driver extends uvm_driver; // #(axi_transaction);
|
||||
|
||||
// --------------------------------------------------
|
||||
// Set agent type
|
||||
function void set_agent_type(agent_type_t atype);
|
||||
function void set_agent_type(axi_agent_type_t atype);
|
||||
agent_type = atype;
|
||||
`uvm_info("set_agent_type", $sformatf("Agent type set to %s", agent_type.name()), UVM_LOW)
|
||||
endfunction
|
@@ -4,7 +4,7 @@
|
||||
class axi_monitor extends uvm_monitor; // #(axi_transaction);
|
||||
virtual `AXI_INTF.MANAGER m_if;
|
||||
virtual `AXI_INTF.SUBORDINATE s_if;
|
||||
agent_type_t agent_type;
|
||||
axi_agent_type_t agent_type;
|
||||
|
||||
// Declare the analysis export
|
||||
uvm_analysis_port ap;
|
||||
@@ -23,7 +23,7 @@ class axi_monitor extends uvm_monitor; // #(axi_transaction);
|
||||
|
||||
// --------------------------------------------------
|
||||
// Set agent type
|
||||
function void set_agent_type(agent_type_t atype);
|
||||
function void set_agent_type(axi_agent_type_t atype);
|
||||
agent_type = atype;
|
||||
`uvm_info("set_agent_type", $sformatf("Agent type set to %s", agent_type.name()), UVM_LOW)
|
||||
endfunction
|
14
src/axi/axi_pkg.sv
Normal file
14
src/axi/axi_pkg.sv
Normal file
@@ -0,0 +1,14 @@
|
||||
package axi_pkg;
|
||||
import uvm_pkg::*;
|
||||
import axi_types::*;
|
||||
|
||||
`include "uvm_macros.svh"
|
||||
|
||||
// UVM data items
|
||||
`include "axi_transaction.sv"
|
||||
|
||||
// UVM components
|
||||
`include "axi_driver.sv"
|
||||
`include "axi_monitor.sv"
|
||||
`include "axi_agent.sv"
|
||||
endpackage
|
@@ -1,10 +1,10 @@
|
||||
// Types
|
||||
package tb_types;
|
||||
// AXI Types
|
||||
package axi_types;
|
||||
// Agent type
|
||||
typedef enum {
|
||||
MANAGER,
|
||||
SUBORDINATE
|
||||
} agent_type_t;
|
||||
} axi_agent_type_t;
|
||||
|
||||
typedef enum {
|
||||
AXI_READ,
|
12
tb/tb_pkg.sv
12
tb/tb_pkg.sv
@@ -1,19 +1,13 @@
|
||||
`include "tb_params.sv"
|
||||
`include "tb_intf.sv"
|
||||
package tb_pkg;
|
||||
import uvm_pkg::*;
|
||||
import tb_types::*;
|
||||
import common_pkg::*;
|
||||
import axi_pkg::*;
|
||||
import axi_types::*;
|
||||
|
||||
`include "uvm_macros.svh"
|
||||
|
||||
// Testbench defines
|
||||
// UVM data items
|
||||
`include "axi_transaction.sv"
|
||||
|
||||
// UVM components
|
||||
`include "axi_driver.sv"
|
||||
`include "axi_monitor.sv"
|
||||
`include "axi_agent.sv"
|
||||
`include "tb_env.sv"
|
||||
|
||||
// UVM sequences
|
||||
|
Reference in New Issue
Block a user