Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pattgen,dv] General code tidy-up #26318

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions hw/ip/pattgen/dv/env/pattgen_env_cfg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,39 @@
// SPDX-License-Identifier: Apache-2.0

class pattgen_env_cfg extends cip_base_env_cfg #(.RAL_T(pattgen_reg_block));
// drained time of phase_ready_to_end
// Drain time of phase_ready_to_end
uint ok_to_end_delay_ns = 8000;

// pattgen_agent_cfg
// Configuration for the pattgen agent (stored in the environment as m_pattgen_agent).
rand pattgen_agent_cfg m_pattgen_agent_cfg;

// seq cfg
// Configuration that applies to the virtual sequences that run in the environment
pattgen_seq_cfg seq_cfg;

extern function new (string name="");

// Implements a function from dv_base_env_cfg. The base class version creates RAL models. This
// extension uses the type of the RAL model to set num_interrupts.
extern virtual function void initialize(bit [TL_AW-1:0] csr_base_addr = '1);

`uvm_object_utils_begin(pattgen_env_cfg)
`uvm_field_object(m_pattgen_agent_cfg, UVM_DEFAULT)
`uvm_object_utils_end
endclass

function pattgen_env_cfg::new (string name="");
super.new(name);

`uvm_object_new
list_of_alerts = pattgen_env_pkg::LIST_OF_ALERTS;

virtual function void initialize(bit [TL_AW-1:0] csr_base_addr = '1);
list_of_alerts = pattgen_env_pkg::LIST_OF_ALERTS;
super.initialize(csr_base_addr);
m_pattgen_agent_cfg = pattgen_agent_cfg::type_id::create("m_pattgen_agent_cfg");
m_pattgen_agent_cfg.if_mode = Device; // setup agent in Device mode

// create pattgen_agent_cfg
m_pattgen_agent_cfg = pattgen_agent_cfg::type_id::create("m_pattgen_agent_cfg");
m_pattgen_agent_cfg.if_mode = Device; // setup agent in Device mode
seq_cfg = pattgen_seq_cfg::type_id::create("seq_cfg");
endfunction

// create the seq_cfg
seq_cfg = pattgen_seq_cfg::type_id::create("seq_cfg");
function void pattgen_env_cfg::initialize(bit [TL_AW-1:0] csr_base_addr = '1);
super.initialize(csr_base_addr);

// set num_interrupts & num_alerts
num_interrupts = ral.intr_state.get_n_used_bits();
endfunction
endclass : pattgen_env_cfg
num_interrupts = ral.intr_state.get_n_used_bits();
endfunction
7 changes: 0 additions & 7 deletions hw/ip/pattgen/dv/env/pattgen_env_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ package pattgen_env_pkg;
NumPattgenIntr = 2
} pattgen_intr_e;

typedef enum bit[1:0] {
NoChannels = 2'b00,
Channel0 = 2'b01,
Channel1 = 2'b10,
AllChannels = 2'b11
} channel_select_e;

typedef enum bit {
Enable = 1'b1,
Disable = 1'b0
Expand Down
6 changes: 0 additions & 6 deletions hw/ip/pattgen/dv/env/pattgen_seq_cfg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ class pattgen_seq_cfg extends uvm_object;
uint pattgen_min_num_runs = 1;
uint pattgen_max_num_runs = 5;

// knobs for pattgen channel
uint pattgen_min_dly = 0;
uint pattgen_max_dly = 5;

// see the specification document, the effective values of prediv, len, and reps
// are incremented from the coresponding register values

Expand All @@ -30,11 +26,9 @@ class pattgen_seq_cfg extends uvm_object;
uint pattgen_min_reps = RepsMinValue;
uint pattgen_max_reps = RepsMaxValue;

uint pattgen_low_polarity_pct = 50; // in percentage
uint pattgen_sync_channels_pct = 30; // in percentage

// for error_vseq
bit error_injected_enb = 1'b0;
uint error_injected_pct = 10; // in percentage
uint data_top_pct = 10;
uint data_bottom_pct = 80;
Expand Down
Loading
Loading