[edn/dv] Modify for multi-bit enables Signed-off-by: Steve Nelson <steve.nelson@wdc.com>
diff --git a/hw/ip/edn/data/edn.hjson b/hw/ip/edn/data/edn.hjson index 8bc528a..dd79f13 100644 --- a/hw/ip/edn/data/edn.hjson +++ b/hw/ip/edn/data/edn.hjson
@@ -71,8 +71,9 @@ swaccess: "rw", hwaccess: "hro", regwen: "REGWEN", + // TODO: Remove exclusion tags: [ // Exclude from writes to these bits since hardware actions will start. - "excl:CsrAllTests:CsrExclWrite"] + "excl:CsrAllTests:CsrExclAll"] fields: [ { bits: "3:0", name: "EDN_ENABLE",
diff --git a/hw/ip/edn/dv/env/edn_env_cfg.sv b/hw/ip/edn/dv/env/edn_env_cfg.sv index ee9de32..a26d194 100644 --- a/hw/ip/edn/dv/env/edn_env_cfg.sv +++ b/hw/ip/edn/dv/env/edn_env_cfg.sv
@@ -19,20 +19,24 @@ `uvm_object_new // Knobs & Weights - uint enable_pct, boot_req_mode_pct, auto_req_mode_pct; + uint enable_pct, boot_req_mode_pct, auto_req_mode_pct; - // TODO: confirm that modes are a signle bit below - rand bit enable; - rand bit boot_req_mode; - rand bit auto_req_mode; + rand bit[3:0] enable; + rand bit[3:0] boot_req_mode; + rand bit[3:0] auto_req_mode; // Constraints - constraint c_enable {enable dist { 1 :/ enable_pct, 0:/ (100 - enable_pct) };} - - constraint c_boot_req_mode {boot_req_mode dist { 1 :/ boot_req_mode_pct, - 0 :/ (100 - boot_req_mode_pct) };} - constraint c_auto_req_mode {auto_req_mode dist { 1 :/ auto_req_mode_pct, - 0 :/ (100 - auto_req_mode_pct) };} + constraint c_enable {enable dist { + edn_pkg::EDN_FIELD_ON :/ enable_pct, + [0:edn_pkg::EDN_FIELD_ON - 1] :/ (100 - enable_pct)/2, + [edn_pkg::EDN_FIELD_ON + 1:$] :/ (100 - enable_pct)/2 };} + constraint c_boot_req_mode {boot_req_mode dist { + edn_pkg::EDN_FIELD_ON :/ boot_req_mode_pct, + [0:edn_pkg::EDN_FIELD_ON - 1] :/ (100 - boot_req_mode_pct)/2, + [edn_pkg::EDN_FIELD_ON + 1:$] :/ (100 - boot_req_mode_pct)/2 };} + constraint c_auto_req_mode {auto_req_mode dist { + [0:edn_pkg::EDN_FIELD_ON - 1] :/ (100 - auto_req_mode_pct)/2, + [edn_pkg::EDN_FIELD_ON + 1:$] :/ (100 - auto_req_mode_pct)/2 };} virtual function void initialize(bit [31:0] csr_base_addr = '1); list_of_alerts = edn_env_pkg::LIST_OF_ALERTS;
diff --git a/hw/ip/edn/dv/env/seq_lib/edn_base_vseq.sv b/hw/ip/edn/dv/env/seq_lib/edn_base_vseq.sv index 9da34a1..8621b46 100644 --- a/hw/ip/edn/dv/env/seq_lib/edn_base_vseq.sv +++ b/hw/ip/edn/dv/env/seq_lib/edn_base_vseq.sv
@@ -32,6 +32,13 @@ virtual task dut_init(string reset_kind = "HARD"); super.dut_init(); + + // Enable edn, set modes + ral.ctrl.edn_enable.set(cfg.enable); + ral.ctrl.boot_req_mode.set(cfg.boot_req_mode); + ral.ctrl.auto_req_mode.set(cfg.auto_req_mode); + csr_update(.csr(ral.ctrl)); + endtask virtual task dut_shutdown();
diff --git a/hw/ip/edn/dv/env/seq_lib/edn_smoke_vseq.sv b/hw/ip/edn/dv/env/seq_lib/edn_smoke_vseq.sv index 51a41c7..4d4c54b 100644 --- a/hw/ip/edn/dv/env/seq_lib/edn_smoke_vseq.sv +++ b/hw/ip/edn/dv/env/seq_lib/edn_smoke_vseq.sv
@@ -12,10 +12,6 @@ task body(); super.body(); - // Enable edn - // TODO: determine if below muxing for field updates is the best way - csr_wr(.ptr(ral.ctrl), .value({(cfg.boot_req_mode ? 4'ha : 4'h0), (cfg.enable ? 4'ha : 4'h0)})); - m_endpoint_pull_seq = push_pull_host_seq#(edn_pkg::FIPS_ENDPOINT_BUS_WIDTH)::type_id:: create("m_endpoint_pull_seq"); m_endpoint_pull_seq.start(p_sequencer.endpoint_sequencer_h[edn_env_pkg::NUM_ENDPOINTS-1]);
diff --git a/hw/ip/edn/dv/tests/edn_smoke_test.sv b/hw/ip/edn/dv/tests/edn_smoke_test.sv index a0d5bba..754052f 100644 --- a/hw/ip/edn/dv/tests/edn_smoke_test.sv +++ b/hw/ip/edn/dv/tests/edn_smoke_test.sv
@@ -10,7 +10,6 @@ function void configure_env(); super.configure_env(); - cfg.auto_req_mode_pct = 0; cfg.boot_req_mode_pct = 100; `DV_CHECK_RANDOMIZE_FATAL(cfg)