Skip to content

Commit

Permalink
[pwm,dv] Remove cfg.blink
Browse files Browse the repository at this point in the history
This is already mirrored in the RAL. Use that instead.

Signed-off-by: Rupert Swarbrick <[email protected]>
  • Loading branch information
rswarbrick committed Nov 8, 2024
1 parent 901b473 commit d83115d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion hw/ip/pwm/dv/env/pwm_env_cfg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions hw/ip/pwm/dv/env/seq_lib/pwm_base_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions hw/ip/pwm/dv/env/seq_lib/pwm_perf_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions hw/ip/pwm/dv/env/seq_lib/pwm_smoke_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d83115d

Please sign in to comment.