diff --git a/dv/uvm/icache/dv/env/ibex_icache_env.core b/dv/uvm/icache/dv/env/ibex_icache_env.core index 885b2f5e..cff52c65 100644 --- a/dv/uvm/icache/dv/env/ibex_icache_env.core +++ b/dv/uvm/icache/dv/env/ibex_icache_env.core @@ -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 diff --git a/dv/uvm/icache/dv/env/ibex_icache_env.sv b/dv/uvm/icache/dv/env/ibex_icache_env.sv index d419ebb0..e6722990 100644 --- a/dv/uvm/icache/dv/env/ibex_icache_env.sv +++ b/dv/uvm/icache/dv/env/ibex_icache_env.sv @@ -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; diff --git a/dv/uvm/icache/dv/env/ibex_icache_env_cfg.sv b/dv/uvm/icache/dv/env/ibex_icache_env_cfg.sv index c8b8dd1b..25c8cd60 100644 --- a/dv/uvm/icache/dv/env/ibex_icache_env_cfg.sv +++ b/dv/uvm/icache/dv/env/ibex_icache_env_cfg.sv @@ -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 diff --git a/dv/uvm/icache/dv/env/ibex_icache_env_pkg.sv b/dv/uvm/icache/dv/env/ibex_icache_env_pkg.sv index eb941be7..2974c197 100644 --- a/dv/uvm/icache/dv/env/ibex_icache_env_pkg.sv +++ b/dv/uvm/icache/dv/env/ibex_icache_env_pkg.sv @@ -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::*; diff --git a/dv/uvm/icache/dv/env/ibex_icache_scoreboard.sv b/dv/uvm/icache/dv/env/ibex_icache_scoreboard.sv index ac3a2a0f..4b230ba9 100644 --- a/dv/uvm/icache/dv/env/ibex_icache_scoreboard.sv +++ b/dv/uvm/icache/dv/env/ibex_icache_scoreboard.sv @@ -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 diff --git a/dv/uvm/icache/dv/env/ibex_icache_virtual_sequencer.sv b/dv/uvm/icache/dv/env/ibex_icache_virtual_sequencer.sv index 4aec3779..40bdd2ad 100644 --- a/dv/uvm/icache/dv/env/ibex_icache_virtual_sequencer.sv +++ b/dv/uvm/icache/dv/env/ibex_icache_virtual_sequencer.sv @@ -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 diff --git a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv index ccd50c82..6c0dbaf5 100644 --- a/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv +++ b/dv/uvm/icache/dv/env/seq_lib/ibex_icache_sanity_vseq.sv @@ -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!) diff --git a/dv/uvm/icache/dv/ibex_icache_agent/README.md b/dv/uvm/icache/dv/ibex_icache_agent/README.md deleted file mode 100644 index 4ee1f428..00000000 --- a/dv/uvm/icache/dv/ibex_icache_agent/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# IBEX_ICACHE UVM Agent - -IBEX_ICACHE UVM Agent is extended from DV library agent classes. diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent.core b/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent.core deleted file mode 100644 index 82ad69bb..00000000 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent.core +++ /dev/null @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent.sv b/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent.sv deleted file mode 100644 index 832ce623..00000000 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent.sv +++ /dev/null @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_pkg.sv b/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_pkg.sv deleted file mode 100644 index f0417acd..00000000 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_pkg.sv +++ /dev/null @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_core_agent/README.md b/dv/uvm/icache/dv/ibex_icache_core_agent/README.md new file mode 100644 index 00000000..ede30049 --- /dev/null +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/README.md @@ -0,0 +1,3 @@ +# ICache Core UVM Agent + +Agent is extended from DV library agent classes. diff --git a/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent.core b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent.core new file mode 100644 index 00000000..21ba0811 --- /dev/null +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent.core @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent.sv new file mode 100644 index 00000000..f6f9be2f --- /dev/null +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_cfg.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_cfg.sv similarity index 65% rename from dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_cfg.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_cfg.sv index d5b5f122..a29f1988 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_cfg.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_cfg.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_cov.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_cov.sv similarity index 68% rename from dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_cov.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_cov.sv index 4176a0d7..dfc924bc 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_agent_cov.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_cov.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_pkg.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_pkg.sv new file mode 100644 index 00000000..179d62fe --- /dev/null +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_agent_pkg.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_driver.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_driver.sv similarity index 88% rename from dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_driver.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_driver.sv index 2aa709aa..f39ea4a8 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_driver.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_driver.sv @@ -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; diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_if.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_if.sv similarity index 97% rename from dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_if.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_if.sv index 26855ed5..bf208bfd 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_if.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_if.sv @@ -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; diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_item.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_item.sv similarity index 75% rename from dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_item.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_item.sv index cb27878e..b89faa84 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_item.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_item.sv @@ -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) diff --git a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_monitor.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_monitor.sv similarity index 69% rename from dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_monitor.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_monitor.sv index 19aaf87f..5ef08f31 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/ibex_icache_monitor.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/ibex_icache_core_monitor.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_base_seq.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_base_seq.sv similarity index 55% rename from dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_base_seq.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_base_seq.sv index 272b32bf..15b03850 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_base_seq.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_base_seq.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_sanity_seq.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_sanity_seq.sv similarity index 71% rename from dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_sanity_seq.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_sanity_seq.sv index dc737253..23aa8f81 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_sanity_seq.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_sanity_seq.sv @@ -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 diff --git a/dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_seq_list.sv b/dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_seq_list.sv similarity index 64% rename from dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_seq_list.sv rename to dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_seq_list.sv index 89415f62..d0bf8eb6 100644 --- a/dv/uvm/icache/dv/ibex_icache_agent/seq_lib/ibex_icache_seq_list.sv +++ b/dv/uvm/icache/dv/ibex_icache_core_agent/seq_lib/ibex_icache_core_seq_list.sv @@ -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" diff --git a/dv/uvm/icache/dv/tb/tb.sv b/dv/uvm/icache/dv/tb/tb.sv index 32525f3c..dc15e309 100644 --- a/dv/uvm/icache/dv/tb/tb.sv +++ b/dv/uvm/icache/dv/tb/tb.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();