From d83115dab468df2ec5dddbab30c33c3aa1db94b0 Mon Sep 17 00:00:00 2001 From: Rupert Swarbrick Date: Fri, 18 Oct 2024 12:27:09 +0100 Subject: [PATCH] [pwm,dv] Remove cfg.blink This is already mirrored in the RAL. Use that instead. Signed-off-by: Rupert Swarbrick --- hw/ip/pwm/dv/env/pwm_env_cfg.sv | 1 - hw/ip/pwm/dv/env/seq_lib/pwm_base_vseq.sv | 8 ++++---- hw/ip/pwm/dv/env/seq_lib/pwm_perf_vseq.sv | 4 +--- hw/ip/pwm/dv/env/seq_lib/pwm_smoke_vseq.sv | 4 +--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/ip/pwm/dv/env/pwm_env_cfg.sv b/hw/ip/pwm/dv/env/pwm_env_cfg.sv index 5439725d4e13a..fd299cb333d27 100644 --- a/hw/ip/pwm/dv/env/pwm_env_cfg.sv +++ b/hw/ip/pwm/dv/env/pwm_env_cfg.sv @@ -16,7 +16,6 @@ class pwm_env_cfg extends cip_base_env_cfg #(.RAL_T(pwm_reg_block)); int core_clk_freq_mhz; // variables - dc_blink_t blink[PWM_NUM_CHANNELS]; param_reg_t pwm_param[PWM_NUM_CHANNELS]; // ratio between bus_clk and core_clk (must be >= 1) rand int clk_ratio; diff --git a/hw/ip/pwm/dv/env/seq_lib/pwm_base_vseq.sv b/hw/ip/pwm/dv/env/seq_lib/pwm_base_vseq.sv index 1cef1e9f5ed5e..2c67f445a8af5 100644 --- a/hw/ip/pwm/dv/env/seq_lib/pwm_base_vseq.sv +++ b/hw/ip/pwm/dv/env/seq_lib/pwm_base_vseq.sv @@ -81,14 +81,14 @@ class pwm_base_vseq extends cip_base_vseq #( // Summation of PARAM.y and DUTY_CYLE.A shouldn't go beyond MAX_16 // This is to prevent counter overflow virtual task automatic rand_pwm_blink(int unsigned channel); - dc_blink_t duty_cycle; + dc_blink_t duty_cycle, blink; `DV_CHECK_FATAL(channel < NOutputs) duty_cycle = `gmv(ral.duty_cycle[channel]); - cfg.blink[channel].B = $urandom_range(1, int'(MAX_16) - duty_cycle.A); - cfg.blink[channel].A = $urandom_range(1, int'(MAX_16) - cfg.blink[channel].B); - set_blink(channel, .A(cfg.blink[channel].A), .B(cfg.blink[channel].B)); + blink.B = $urandom_range(1, int'(MAX_16) - duty_cycle.A); + blink.A = $urandom_range(1, int'(MAX_16) - blink.B); + set_blink(channel, .A(blink.A), .B(blink.B)); endtask virtual task set_param(int unsigned channel, param_reg_t value); diff --git a/hw/ip/pwm/dv/env/seq_lib/pwm_perf_vseq.sv b/hw/ip/pwm/dv/env/seq_lib/pwm_perf_vseq.sv index 4d1a0dc9db592..0465ab08aea68 100644 --- a/hw/ip/pwm/dv/env/seq_lib/pwm_perf_vseq.sv +++ b/hw/ip/pwm/dv/env/seq_lib/pwm_perf_vseq.sv @@ -50,9 +50,7 @@ class pwm_perf_vseq extends pwm_rand_output_vseq; for (uint i = 0; i < PWM_NUM_CHANNELS; i++) begin set_duty_cycle(i, .A(rand_dc[i]), .B(rand_dc[i])); - cfg.blink[i].A = rand_blink[i]; - cfg.blink[i].B = rand_blink[i]; - set_blink(i, .A(cfg.blink[i].A), .B(cfg.blink[i].B)); + set_blink(i, .A(rand_blink[i]), .B(rand_blink[i])); cfg.pwm_param[i].HtbtEn = rand_reg_param.HtbtEn; cfg.pwm_param[i].BlinkEn = rand_reg_param.BlinkEn; diff --git a/hw/ip/pwm/dv/env/seq_lib/pwm_smoke_vseq.sv b/hw/ip/pwm/dv/env/seq_lib/pwm_smoke_vseq.sv index daae8826190aa..80a133c47e081 100644 --- a/hw/ip/pwm/dv/env/seq_lib/pwm_smoke_vseq.sv +++ b/hw/ip/pwm/dv/env/seq_lib/pwm_smoke_vseq.sv @@ -24,12 +24,10 @@ class pwm_smoke_vseq extends pwm_base_vseq; //setup general config set_cfg_reg(10, 1, 1); - cfg.blink[0].A = 0; - cfg.blink[0].B = 0; cfg.pwm_param[0].BlinkEn = 1; set_duty_cycle(.channel(0), .A(13000), .B(6500)); - set_blink(.channel(0), .A(cfg.blink[0].A), .B(cfg.blink[0].B)); + set_blink(.channel(0), .A(0), .B(0)); set_param(0, cfg.pwm_param[0]); // enable channel 0