mirror of
https://github.com/lowRISC/ibex.git
synced 2025-04-22 12:57:13 -04:00
Rename ibex_icache_agent -> ibex_icache_core_agent
There is more than one icache-specific agent that we need for the icache testbench, so "ibex_icache_agent" isn't a very helpful name. This commit was pretty much automated, except for a few spacing cleanups, with commands like: git grep -l ibex_icache_agent | \ xargs sed -i 's!ibex_icache_agent!ibex_icache_core_agent!g' (and then rename the directory and files).
This commit is contained in:
parent
38422a03bc
commit
5c51bc7e4d
25 changed files with 168 additions and 172 deletions
2
dv/uvm/icache/dv/env/ibex_icache_env.core
vendored
2
dv/uvm/icache/dv/env/ibex_icache_env.core
vendored
|
@ -8,7 +8,7 @@ filesets:
|
|||
files_dv:
|
||||
depend:
|
||||
- lowrisc:dv:dv_lib
|
||||
- lowrisc:dv:ibex_icache_agent
|
||||
- lowrisc:dv:ibex_icache_core_agent
|
||||
- lowrisc:dv:ibex_mem_intf_agent
|
||||
files:
|
||||
- ibex_icache_env_pkg.sv
|
||||
|
|
12
dv/uvm/icache/dv/env/ibex_icache_env.sv
vendored
12
dv/uvm/icache/dv/env/ibex_icache_env.sv
vendored
|
@ -10,7 +10,7 @@ class ibex_icache_env extends dv_base_env #(
|
|||
);
|
||||
`uvm_component_utils(ibex_icache_env)
|
||||
|
||||
ibex_icache_agent m_ibex_icache_agent;
|
||||
ibex_icache_core_agent m_ibex_icache_core_agent;
|
||||
ibex_mem_intf_slave_agent m_ibex_mem_intf_slave_agent;
|
||||
|
||||
`uvm_component_new
|
||||
|
@ -18,8 +18,8 @@ class ibex_icache_env extends dv_base_env #(
|
|||
function void build_phase(uvm_phase phase);
|
||||
super.build_phase(phase);
|
||||
// create components
|
||||
m_ibex_icache_agent = ibex_icache_agent::type_id::create("m_ibex_icache_agent", this);
|
||||
uvm_config_db#(ibex_icache_agent_cfg)::set(this, "m_ibex_icache_agent*", "cfg", cfg.m_ibex_icache_agent_cfg);
|
||||
m_ibex_icache_core_agent = ibex_icache_core_agent::type_id::create("m_ibex_icache_core_agent", this);
|
||||
uvm_config_db#(ibex_icache_core_agent_cfg)::set(this, "m_ibex_icache_core_agent*", "cfg", cfg.m_ibex_icache_core_agent_cfg);
|
||||
// create components
|
||||
m_ibex_mem_intf_slave_agent = ibex_mem_intf_slave_agent::type_id::create("m_ibex_mem_intf_slave_agent", this);
|
||||
endfunction
|
||||
|
@ -27,11 +27,11 @@ class ibex_icache_env extends dv_base_env #(
|
|||
function void connect_phase(uvm_phase phase);
|
||||
super.connect_phase(phase);
|
||||
if (cfg.en_scb) begin
|
||||
m_ibex_icache_agent.monitor.analysis_port.connect(scoreboard.ibex_icache_fifo.analysis_export);
|
||||
m_ibex_icache_core_agent.monitor.analysis_port.connect(scoreboard.ibex_icache_fifo.analysis_export);
|
||||
m_ibex_mem_intf_slave_agent.monitor.addr_ph_port.connect(scoreboard.ibex_mem_intf_slave_fifo.analysis_export);
|
||||
end
|
||||
if (cfg.is_active && cfg.m_ibex_icache_agent_cfg.is_active) begin
|
||||
virtual_sequencer.core_sequencer_h = m_ibex_icache_agent.sequencer;
|
||||
if (cfg.is_active && cfg.m_ibex_icache_core_agent_cfg.is_active) begin
|
||||
virtual_sequencer.core_sequencer_h = m_ibex_icache_core_agent.sequencer;
|
||||
end
|
||||
if (cfg.is_active && m_ibex_mem_intf_slave_agent.get_is_active()) begin
|
||||
virtual_sequencer.mem_sequencer_h = m_ibex_mem_intf_slave_agent.sequencer;
|
||||
|
|
6
dv/uvm/icache/dv/env/ibex_icache_env_cfg.sv
vendored
6
dv/uvm/icache/dv/env/ibex_icache_env_cfg.sv
vendored
|
@ -5,10 +5,10 @@
|
|||
class ibex_icache_env_cfg extends dv_base_env_cfg;
|
||||
|
||||
// ext component cfgs
|
||||
rand ibex_icache_agent_cfg m_ibex_icache_agent_cfg;
|
||||
rand ibex_icache_core_agent_cfg m_ibex_icache_core_agent_cfg;
|
||||
|
||||
`uvm_object_utils_begin(ibex_icache_env_cfg)
|
||||
`uvm_field_object(m_ibex_icache_agent_cfg, UVM_DEFAULT)
|
||||
`uvm_field_object(m_ibex_icache_core_agent_cfg, UVM_DEFAULT)
|
||||
`uvm_object_utils_end
|
||||
|
||||
`uvm_object_new
|
||||
|
@ -16,7 +16,7 @@ class ibex_icache_env_cfg extends dv_base_env_cfg;
|
|||
|
||||
virtual function void initialize(bit [TL_AW-1:0] csr_base_addr = '1);
|
||||
// create ibex_icache agent config obj
|
||||
m_ibex_icache_agent_cfg = ibex_icache_agent_cfg::type_id::create("m_ibex_icache_agent_cfg");
|
||||
m_ibex_icache_core_agent_cfg = ibex_icache_core_agent_cfg::type_id::create("m_ibex_icache_core_agent_cfg");
|
||||
// create ibex_mem_intf_slave agent config obj
|
||||
endfunction
|
||||
|
||||
|
|
2
dv/uvm/icache/dv/env/ibex_icache_env_pkg.sv
vendored
2
dv/uvm/icache/dv/env/ibex_icache_env_pkg.sv
vendored
|
@ -7,7 +7,7 @@ package ibex_icache_env_pkg;
|
|||
import uvm_pkg::*;
|
||||
import top_pkg::*;
|
||||
import dv_utils_pkg::*;
|
||||
import ibex_icache_agent_pkg::*;
|
||||
import ibex_icache_core_agent_pkg::*;
|
||||
import ibex_mem_intf_agent_pkg::*;
|
||||
import dv_lib_pkg::*;
|
||||
|
||||
|
|
16
dv/uvm/icache/dv/env/ibex_icache_scoreboard.sv
vendored
16
dv/uvm/icache/dv/env/ibex_icache_scoreboard.sv
vendored
|
@ -11,12 +11,8 @@ class ibex_icache_scoreboard extends dv_base_scoreboard #(
|
|||
// local variables
|
||||
|
||||
// TLM agent fifos
|
||||
uvm_tlm_analysis_fifo #(ibex_icache_item) ibex_icache_fifo;
|
||||
uvm_tlm_analysis_fifo #(ibex_mem_intf_seq_item) ibex_mem_intf_slave_fifo;
|
||||
|
||||
// local queues to hold incoming packets pending comparison
|
||||
ibex_icache_item ibex_icache_q[$];
|
||||
ibex_mem_intf_seq_item ibex_mem_intf_slave_q[$];
|
||||
uvm_tlm_analysis_fifo #(ibex_icache_core_item) core_fifo;
|
||||
uvm_tlm_analysis_fifo #(ibex_mem_intf_seq_item) mem_fifo;
|
||||
|
||||
`uvm_component_new
|
||||
|
||||
|
@ -39,17 +35,17 @@ class ibex_icache_scoreboard extends dv_base_scoreboard #(
|
|||
endtask
|
||||
|
||||
virtual task process_ibex_icache_fifo();
|
||||
ibex_icache_item item;
|
||||
ibex_icache_core_item item;
|
||||
forever begin
|
||||
ibex_icache_fifo.get(item);
|
||||
`uvm_info(`gfn, $sformatf("received ibex_icache item:\n%0s", item.sprint()), UVM_HIGH)
|
||||
core_fifo.get(item);
|
||||
`uvm_info(`gfn, $sformatf("received ibex_icache_core item:\n%0s", item.sprint()), UVM_HIGH)
|
||||
end
|
||||
endtask
|
||||
|
||||
virtual task process_ibex_mem_intf_slave_fifo();
|
||||
ibex_mem_intf_seq_item item;
|
||||
forever begin
|
||||
ibex_mem_intf_slave_fifo.get(item);
|
||||
mem_fifo.get(item);
|
||||
`uvm_info(`gfn, $sformatf("received ibex_mem_intf_seq item:\n%0s", item.sprint()), UVM_HIGH)
|
||||
end
|
||||
endtask
|
||||
|
|
|
@ -8,7 +8,7 @@ class ibex_icache_virtual_sequencer extends dv_base_virtual_sequencer #(
|
|||
);
|
||||
`uvm_component_utils(ibex_icache_virtual_sequencer)
|
||||
|
||||
ibex_icache_sequencer core_sequencer_h;
|
||||
ibex_icache_core_sequencer core_sequencer_h;
|
||||
ibex_mem_intf_slave_sequencer mem_sequencer_h;
|
||||
|
||||
`uvm_component_new
|
||||
|
|
|
@ -10,7 +10,7 @@ class ibex_icache_sanity_vseq extends ibex_icache_base_vseq;
|
|||
`uvm_object_new
|
||||
|
||||
// A sanity sequence for the core agent
|
||||
ibex_icache_sanity_seq core_seq;
|
||||
ibex_icache_core_sanity_seq core_seq;
|
||||
|
||||
task body();
|
||||
// TODO: This currently just drives the core sequence (which clearly isn't going to work!)
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# IBEX_ICACHE UVM Agent
|
||||
|
||||
IBEX_ICACHE UVM Agent is extended from DV library agent classes.
|
|
@ -1,29 +0,0 @@
|
|||
CAPI=2:
|
||||
# Copyright lowRISC contributors.
|
||||
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
name: "lowrisc:dv:ibex_icache_agent:0.1"
|
||||
description: "IBEX_ICACHE DV UVM agent"
|
||||
filesets:
|
||||
files_dv:
|
||||
depend:
|
||||
- lowrisc:dv:dv_utils
|
||||
- lowrisc:dv:dv_lib
|
||||
files:
|
||||
- ibex_icache_if.sv
|
||||
- ibex_icache_agent_pkg.sv
|
||||
- ibex_icache_item.sv: {is_include_file: true}
|
||||
- ibex_icache_agent_cfg.sv: {is_include_file: true}
|
||||
- ibex_icache_agent_cov.sv: {is_include_file: true}
|
||||
- ibex_icache_driver.sv: {is_include_file: true}
|
||||
- ibex_icache_monitor.sv: {is_include_file: true}
|
||||
- ibex_icache_agent.sv: {is_include_file: true}
|
||||
- seq_lib/ibex_icache_base_seq.sv: {is_include_file: true}
|
||||
- seq_lib/ibex_icache_sanity_seq.sv: {is_include_file: true}
|
||||
- seq_lib/ibex_icache_seq_list.sv: {is_include_file: true}
|
||||
file_type: systemVerilogSource
|
||||
|
||||
targets:
|
||||
default:
|
||||
filesets:
|
||||
- files_dv
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright lowRISC contributors.
|
||||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_agent extends dv_base_agent #(
|
||||
.CFG_T (ibex_icache_agent_cfg),
|
||||
.DRIVER_T (ibex_icache_driver),
|
||||
.SEQUENCER_T (ibex_icache_sequencer),
|
||||
.MONITOR_T (ibex_icache_monitor),
|
||||
.COV_T (ibex_icache_agent_cov)
|
||||
);
|
||||
|
||||
`uvm_component_utils(ibex_icache_agent)
|
||||
|
||||
`uvm_component_new
|
||||
|
||||
function void build_phase(uvm_phase phase);
|
||||
super.build_phase(phase);
|
||||
// get ibex_icache_if handle
|
||||
if (!uvm_config_db#(virtual ibex_icache_if)::get(this, "", "vif", cfg.vif)) begin
|
||||
`uvm_fatal(`gfn, "failed to get ibex_icache_if handle from uvm_config_db")
|
||||
end
|
||||
endfunction
|
||||
|
||||
endclass
|
|
@ -1,42 +0,0 @@
|
|||
// Copyright lowRISC contributors.
|
||||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package ibex_icache_agent_pkg;
|
||||
// dep packages
|
||||
import uvm_pkg::*;
|
||||
import dv_utils_pkg::*;
|
||||
import dv_lib_pkg::*;
|
||||
|
||||
typedef enum {
|
||||
ICacheTransTypeBranch,
|
||||
ICacheTransTypeReq
|
||||
} ibex_icache_trans_type_e;
|
||||
|
||||
// macro includes
|
||||
`include "uvm_macros.svh"
|
||||
`include "dv_macros.svh"
|
||||
|
||||
// parameters
|
||||
|
||||
// local types
|
||||
// forward declare classes to allow typedefs below
|
||||
typedef class ibex_icache_item;
|
||||
typedef class ibex_icache_agent_cfg;
|
||||
|
||||
// reuse dv_base_sequencer as is with the right parameter set
|
||||
typedef dv_base_sequencer #(.ITEM_T(ibex_icache_item),
|
||||
.CFG_T (ibex_icache_agent_cfg)) ibex_icache_sequencer;
|
||||
|
||||
// functions
|
||||
|
||||
// package sources
|
||||
`include "ibex_icache_item.sv"
|
||||
`include "ibex_icache_agent_cfg.sv"
|
||||
`include "ibex_icache_agent_cov.sv"
|
||||
`include "ibex_icache_driver.sv"
|
||||
`include "ibex_icache_monitor.sv"
|
||||
`include "ibex_icache_agent.sv"
|
||||
`include "ibex_icache_seq_list.sv"
|
||||
|
||||
endpackage: ibex_icache_agent_pkg
|
3
dv/uvm/icache/dv/ibex_icache_core_agent/README.md
Normal file
3
dv/uvm/icache/dv/ibex_icache_core_agent/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# ICache Core UVM Agent
|
||||
|
||||
Agent is extended from DV library agent classes.
|
|
@ -0,0 +1,29 @@
|
|||
CAPI=2:
|
||||
# Copyright lowRISC contributors.
|
||||
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
name: "lowrisc:dv:ibex_icache_core_agent:0.1"
|
||||
description: "IBEX_ICACHE DV UVM agent"
|
||||
filesets:
|
||||
files_dv:
|
||||
depend:
|
||||
- lowrisc:dv:dv_utils
|
||||
- lowrisc:dv:dv_lib
|
||||
files:
|
||||
- ibex_icache_core_if.sv
|
||||
- ibex_icache_core_agent_pkg.sv
|
||||
- ibex_icache_core_item.sv: {is_include_file: true}
|
||||
- ibex_icache_core_agent_cfg.sv: {is_include_file: true}
|
||||
- ibex_icache_core_agent_cov.sv: {is_include_file: true}
|
||||
- ibex_icache_core_driver.sv: {is_include_file: true}
|
||||
- ibex_icache_core_monitor.sv: {is_include_file: true}
|
||||
- ibex_icache_core_agent.sv: {is_include_file: true}
|
||||
- seq_lib/ibex_icache_core_base_seq.sv: {is_include_file: true}
|
||||
- seq_lib/ibex_icache_core_sanity_seq.sv: {is_include_file: true}
|
||||
- seq_lib/ibex_icache_core_seq_list.sv: {is_include_file: true}
|
||||
file_type: systemVerilogSource
|
||||
|
||||
targets:
|
||||
default:
|
||||
filesets:
|
||||
- files_dv
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright lowRISC contributors.
|
||||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_core_agent extends dv_base_agent #(
|
||||
.CFG_T (ibex_icache_core_agent_cfg),
|
||||
.DRIVER_T (ibex_icache_core_driver),
|
||||
.SEQUENCER_T (ibex_icache_core_sequencer),
|
||||
.MONITOR_T (ibex_icache_core_monitor),
|
||||
.COV_T (ibex_icache_core_agent_cov)
|
||||
);
|
||||
|
||||
`uvm_component_utils(ibex_icache_core_agent)
|
||||
|
||||
`uvm_component_new
|
||||
|
||||
function void build_phase(uvm_phase phase);
|
||||
super.build_phase(phase);
|
||||
// get ibex_icache_core_if handle
|
||||
if (!uvm_config_db#(virtual ibex_icache_core_if)::get(this, "", "vif", cfg.vif)) begin
|
||||
`uvm_fatal(`gfn, "failed to get ibex_icache_core_if handle from uvm_config_db")
|
||||
end
|
||||
endfunction
|
||||
|
||||
endclass
|
|
@ -2,12 +2,12 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_agent_cfg extends dv_base_agent_cfg;
|
||||
class ibex_icache_core_agent_cfg extends dv_base_agent_cfg;
|
||||
|
||||
// interface handle used by driver, monitor & the sequencer, via cfg handle
|
||||
virtual ibex_icache_if vif;
|
||||
virtual ibex_icache_core_if vif;
|
||||
|
||||
`uvm_object_utils_begin(ibex_icache_agent_cfg)
|
||||
`uvm_object_utils_begin(ibex_icache_core_agent_cfg)
|
||||
`uvm_object_utils_end
|
||||
|
||||
`uvm_object_new
|
|
@ -2,11 +2,11 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_agent_cov extends dv_base_agent_cov #(ibex_icache_agent_cfg);
|
||||
`uvm_component_utils(ibex_icache_agent_cov)
|
||||
class ibex_icache_core_agent_cov extends dv_base_agent_cov #(ibex_icache_core_agent_cfg);
|
||||
`uvm_component_utils(ibex_icache_core_agent_cov)
|
||||
|
||||
// the base class provides the following handles for use:
|
||||
// ibex_icache_agent_cfg: cfg
|
||||
// ibex_icache_core_agent_cfg: cfg
|
||||
|
||||
// covergroups
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright lowRISC contributors.
|
||||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package ibex_icache_core_agent_pkg;
|
||||
// dep packages
|
||||
import uvm_pkg::*;
|
||||
import dv_utils_pkg::*;
|
||||
import dv_lib_pkg::*;
|
||||
|
||||
typedef enum {
|
||||
ICacheCoreTransTypeBranch,
|
||||
ICacheCoreTransTypeReq
|
||||
} ibex_icache_core_trans_type_e;
|
||||
|
||||
// macro includes
|
||||
`include "uvm_macros.svh"
|
||||
`include "dv_macros.svh"
|
||||
|
||||
// parameters
|
||||
|
||||
// local types
|
||||
// forward declare classes to allow typedefs below
|
||||
typedef class ibex_icache_core_item;
|
||||
typedef class ibex_icache_core_agent_cfg;
|
||||
|
||||
// reuse dv_base_seqeuncer as is with the right parameter set
|
||||
typedef dv_base_sequencer #(.ITEM_T(ibex_icache_core_item),
|
||||
.CFG_T (ibex_icache_core_agent_cfg)) ibex_icache_core_sequencer;
|
||||
|
||||
// functions
|
||||
|
||||
// package sources
|
||||
`include "ibex_icache_core_item.sv"
|
||||
`include "ibex_icache_core_agent_cfg.sv"
|
||||
`include "ibex_icache_core_agent_cov.sv"
|
||||
`include "ibex_icache_core_driver.sv"
|
||||
`include "ibex_icache_core_monitor.sv"
|
||||
`include "ibex_icache_core_agent.sv"
|
||||
`include "ibex_icache_core_seq_list.sv"
|
||||
|
||||
endpackage: ibex_icache_core_agent_pkg
|
|
@ -2,8 +2,8 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_driver extends dv_base_driver #(ibex_icache_item, ibex_icache_agent_cfg);
|
||||
`uvm_component_utils(ibex_icache_driver)
|
||||
class ibex_icache_core_driver extends dv_base_driver #(ibex_icache_core_item, ibex_icache_core_agent_cfg);
|
||||
`uvm_component_utils(ibex_icache_core_driver)
|
||||
`uvm_component_new
|
||||
|
||||
// reset signals
|
||||
|
@ -18,9 +18,9 @@ class ibex_icache_driver extends dv_base_driver #(ibex_icache_item, ibex_icache_
|
|||
`uvm_info(`gfn, $sformatf("rcvd item:\n%0s", req.sprint()), UVM_HIGH)
|
||||
|
||||
case (req.trans_type)
|
||||
ICacheTransTypeBranch: drive_branch_trans(req);
|
||||
ICacheTransTypeReq: drive_req_trans(req);
|
||||
default: `uvm_fatal(`gfn, "Unknown transaction type")
|
||||
ICacheCoreTransTypeBranch: drive_branch_trans(req);
|
||||
ICacheCoreTransTypeReq: drive_req_trans(req);
|
||||
default: `uvm_fatal(`gfn, "Unknown transaction type")
|
||||
endcase
|
||||
|
||||
`uvm_info(`gfn, "item sent", UVM_HIGH)
|
||||
|
@ -32,7 +32,7 @@ class ibex_icache_driver extends dv_base_driver #(ibex_icache_item, ibex_icache_
|
|||
//
|
||||
// This concurrently asserts branch with a given address for a cycle while doing the usual
|
||||
// (enable/disable, invalidate, read instructions).
|
||||
virtual task automatic drive_branch_trans(ibex_icache_item req);
|
||||
virtual task automatic drive_branch_trans(ibex_icache_core_item req);
|
||||
// Make sure that req is enabled (has no effect unless this is the first transaction)
|
||||
cfg.vif.req <= 1'b1;
|
||||
|
||||
|
@ -48,7 +48,7 @@ class ibex_icache_driver extends dv_base_driver #(ibex_icache_item, ibex_icache_
|
|||
//
|
||||
// This lowers req for zero or more cycles, at the same time as setting the enable pin and (maybe)
|
||||
// pulsing the invalidate line. Once that is done, it reads zero or more instructions.
|
||||
virtual task automatic drive_req_trans(ibex_icache_item req);
|
||||
virtual task automatic drive_req_trans(ibex_icache_core_item req);
|
||||
int unsigned req_low_cycles;
|
||||
bit allow_no_low_cycles;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
interface ibex_icache_if (input clk);
|
||||
interface ibex_icache_core_if (input clk);
|
||||
|
||||
// Set when core is enabled (and might request instructions soon)
|
||||
logic req;
|
|
@ -2,28 +2,28 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_item extends uvm_sequence_item;
|
||||
class ibex_icache_core_item extends uvm_sequence_item;
|
||||
|
||||
// The type of transaction
|
||||
rand ibex_icache_trans_type_e trans_type;
|
||||
rand ibex_icache_core_trans_type_e trans_type;
|
||||
|
||||
// The branch address for a branch transaction (only has effect if trans_type is
|
||||
// ICacheTransTypeBranch)
|
||||
rand bit [31:0] branch_addr;
|
||||
// ICacheCoreTransTypeBranch)
|
||||
rand bit [31:0] branch_addr;
|
||||
|
||||
// Whether the cache enable/disable should be toggled
|
||||
rand bit toggle_enable;
|
||||
rand bit toggle_enable;
|
||||
|
||||
// Whether to invalidate the cache
|
||||
rand bit invalidate;
|
||||
rand bit invalidate;
|
||||
|
||||
// The number of instructions to read (always non-negative, but may be zero)
|
||||
rand int num_insns;
|
||||
rand int num_insns;
|
||||
|
||||
constraint c_non_branch_trans_addr {
|
||||
// If the transaction type is ICacheTransTypeBranch then branch_addr can be anything. To make
|
||||
// reading debug logs a bit easier, we force it to be zero otherwise.
|
||||
(trans_type != ICacheTransTypeBranch) -> branch_addr == 0;
|
||||
// If the transaction type is ICacheCoreTransTypeBranch then branch_addr can be anything. To
|
||||
// make reading debug logs a bit easier, we force it to be zero otherwise.
|
||||
(trans_type != ICacheCoreTransTypeBranch) -> branch_addr == 0;
|
||||
|
||||
// Pick trans_type before the other values. We need to do this because constraining branch_addr
|
||||
// to 0 for non-branch transactions would otherwise mean branch transactions got weighted 2^32
|
||||
|
@ -55,15 +55,15 @@ class ibex_icache_item extends uvm_sequence_item;
|
|||
// transactions, much less so. Also, we don't bother with long sequences for req transactions:
|
||||
// they won't look any different from the tail end of branch transactions from the cache's point
|
||||
// of view.
|
||||
if (trans_type == ICacheTransTypeBranch)
|
||||
if (trans_type == ICacheCoreTransTypeBranch)
|
||||
num_insns dist { 0 :/ 5, [1:20] :/ 20, [21:100] :/ 1 };
|
||||
else
|
||||
num_insns dist { 0 :/ 1, [1:20] :/ 20 };
|
||||
}
|
||||
|
||||
|
||||
`uvm_object_utils_begin(ibex_icache_item)
|
||||
`uvm_field_enum(ibex_icache_trans_type_e, trans_type, UVM_DEFAULT)
|
||||
`uvm_object_utils_begin(ibex_icache_core_item)
|
||||
`uvm_field_enum(ibex_icache_core_trans_type_e, trans_type, UVM_DEFAULT)
|
||||
`uvm_field_int (branch_addr, UVM_DEFAULT | UVM_HEX)
|
||||
`uvm_field_int (toggle_enable, UVM_DEFAULT)
|
||||
`uvm_field_int (invalidate, UVM_DEFAULT)
|
|
@ -2,17 +2,17 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_monitor extends dv_base_monitor #(
|
||||
.ITEM_T (ibex_icache_item),
|
||||
.CFG_T (ibex_icache_agent_cfg),
|
||||
.COV_T (ibex_icache_agent_cov)
|
||||
class ibex_icache_core_monitor extends dv_base_monitor #(
|
||||
.ITEM_T (ibex_icache_core_item),
|
||||
.CFG_T (ibex_icache_core_agent_cfg),
|
||||
.COV_T (ibex_icache_core_agent_cov)
|
||||
);
|
||||
`uvm_component_utils(ibex_icache_monitor)
|
||||
`uvm_component_utils(ibex_icache_core_monitor)
|
||||
|
||||
// the base class provides the following handles for use:
|
||||
// ibex_icache_agent_cfg: cfg
|
||||
// ibex_icache_agent_cov: cov
|
||||
// uvm_analysis_port #(ibex_icache_item): analysis_port
|
||||
// ibex_icache_core_agent_cfg: cfg
|
||||
// ibex_icache_core_agent_cov: cov
|
||||
// uvm_analysis_port #(ibex_icache_core_item): analysis_port
|
||||
|
||||
`uvm_component_new
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
class ibex_icache_base_seq extends dv_base_seq #(
|
||||
.REQ (ibex_icache_item),
|
||||
.CFG_T (ibex_icache_agent_cfg),
|
||||
.SEQUENCER_T (ibex_icache_sequencer)
|
||||
class ibex_icache_core_base_seq extends dv_base_seq #(
|
||||
.REQ (ibex_icache_core_item),
|
||||
.CFG_T (ibex_icache_core_agent_cfg),
|
||||
.SEQUENCER_T (ibex_icache_core_sequencer)
|
||||
);
|
||||
`uvm_object_utils(ibex_icache_base_seq)
|
||||
`uvm_object_utils(ibex_icache_core_base_seq)
|
||||
|
||||
`uvm_object_new
|
||||
|
|
@ -5,19 +5,19 @@
|
|||
// Sanity test seq
|
||||
//
|
||||
// This is unlikely to find many cache hits (since it branches all over the 4GiB address space).
|
||||
class ibex_icache_sanity_seq extends ibex_icache_base_seq;
|
||||
`uvm_object_utils(ibex_icache_sanity_seq)
|
||||
class ibex_icache_core_sanity_seq extends ibex_icache_core_base_seq;
|
||||
`uvm_object_utils(ibex_icache_core_sanity_seq)
|
||||
`uvm_object_new
|
||||
|
||||
rand int count;
|
||||
constraint c_count { count > 0; count < 100; }
|
||||
|
||||
task body();
|
||||
// Generate a request which is constrained to have trans_type ICacheTransTypeBranch: the core
|
||||
// must start with a branch to tell the cache where to fetch from in the first place.
|
||||
req = ibex_icache_item::type_id::create("req");
|
||||
// Generate a request which is constrained to have trans_type ICacheCoreTransTypeBranch: the
|
||||
// core must start with a branch to tell the cache where to fetch from in the first place.
|
||||
req = ibex_icache_core_item::type_id::create("req");
|
||||
start_item(req);
|
||||
`DV_CHECK_RANDOMIZE_WITH_FATAL(req, req.trans_type == ICacheTransTypeBranch;)
|
||||
`DV_CHECK_RANDOMIZE_WITH_FATAL(req, req.trans_type == ICacheCoreTransTypeBranch;)
|
||||
finish_item(req);
|
||||
|
||||
// Generate and run count ibex_icache_item sequence items (with no other constraint) through the
|
|
@ -2,5 +2,5 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
`include "ibex_icache_base_seq.sv"
|
||||
`include "ibex_icache_sanity_seq.sv"
|
||||
`include "ibex_icache_core_base_seq.sv"
|
||||
`include "ibex_icache_core_sanity_seq.sv"
|
|
@ -17,7 +17,7 @@ module tb;
|
|||
|
||||
// interfaces
|
||||
clk_rst_if clk_rst_if(.clk(clk), .rst_n(rst_n));
|
||||
ibex_icache_if core_if (.clk(clk));
|
||||
ibex_icache_core_if core_if (.clk(clk));
|
||||
ibex_mem_intf ibex_mem_intf();
|
||||
|
||||
// dut
|
||||
|
@ -46,7 +46,7 @@ module tb;
|
|||
// drive clk and rst_n from clk_if
|
||||
clk_rst_if.set_active();
|
||||
uvm_config_db#(virtual clk_rst_if)::set(null, "*.env", "clk_rst_vif", clk_rst_if);
|
||||
uvm_config_db#(virtual ibex_icache_if)::set(null, "*.env.m_ibex_icache_agent*", "vif", core_if);
|
||||
uvm_config_db#(virtual ibex_icache_core_if)::set(null, "*.env.m_ibex_icache_core_agent*", "vif", core_if);
|
||||
uvm_config_db#(virtual ibex_mem_intf)::set(null, "*.env.m_ibex_mem_intf_slave_agent*", "vif", ibex_mem_intf);
|
||||
$timeformat(-12, 0, " ps", 12);
|
||||
run_test();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue