Skip to content

Commit a98d701

Browse files
committed
FIX: 1.8V assertion checking
1 parent e615196 commit a98d701

File tree

2 files changed

+48
-11
lines changed

2 files changed

+48
-11
lines changed

bench/verilog/mdl_sdio.v

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,13 @@ module mdl_sdio #(
604604
// It is illegal to ever change from 1.8V back to 3.3V while the card
605605
// is inserted.
606606
always @(negedge i_1p8v)
607-
assert(!set_1p8v) else $display("NEGEDGE ASSERTION FAIL at %t", $time);
607+
begin
608+
// assert(!set_1p8v) else $display("NEGEDGE ASSERTION FAIL at %t", $time);
609+
if (!set_1p8v) begin end else begin
610+
$display("NEGEDGE ASSERTION FAIL at %t", $time);
611+
assert(!set_1p8v);
612+
end
613+
end
608614

609615
// Following a request to switch to 1p8v, we *must* switch to 1p8v.
610616
always @(posedge sd_clk)

bench/verilog/sim_run.pl

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
## Purpose: Runs one or more of the test cases described in
99
## dev_testcases.txt.
1010
##
11+
## This module is now multi-tasked. Multiple simulations may run
12+
## concurrently, up to (the internal value) $maxtasks.
13+
##
1114
## Creator: Dan Gisselquist, Ph.D.
1215
## Gisselquist Technology, LLC
1316
##
@@ -51,6 +54,8 @@
5154
$cputop = "tb_cpu";
5255
$testd = "test/";
5356
$vivado = 0;
57+
$ntasks = 0;
58+
$maxtasks = 16;
5459

5560
## Usage: perl sim_sim.pl all
5661
## or
@@ -170,6 +175,7 @@ ($)
170175
## {{{
171176
## Remove any prior build products, so we can detect a failed
172177
## build.
178+
$exefile = $testd . $tstname;
173179
if (-e $exefile) {
174180
unlink $exefile;
175181
}
@@ -256,6 +262,11 @@ ($)
256262
## Run the simulation
257263
## {{{
258264
$tstamp = timestamp();
265+
$pid = fork;
266+
if ($pid ne 0) {
267+
return;
268+
}
269+
259270
system "echo \"$tstamp -- Starting simulation\" | tee -a $sim_log";
260271
system "$exefile >> $sim_log";
261272

@@ -285,28 +296,30 @@ ($)
285296
system "grep -iq \'TEST PASS\' $sim_log";
286297
$errS = $?;
287298

288-
open (SUM,">> $report");
289299
if ($errE == 0 or $errA == 0 or $errF == 0) {
290300
## ERRORs found, either assertion or other fail
291-
print SUM "ERRORS $msg\n";
292-
print "ERRORS $msg\n";
301+
$msg = sprintf("ERRORS %s\n", $msg);
293302
push @failed,$tstname;
294303
} elsif ($errT == 0) {
295304
# Timing violations present
296-
print SUM "TIMING-ER $msg\n";
297-
print "TIMING-ER $msg\n";
305+
$msg = sprintf("TIMING-ER %s\n", $msg);
298306
push @failed,$tstname;
299307
} elsif ($errS != 0) {
300308
# No success (TEST_PASS) message present
301-
print SUM "FAIL $msg\n";
302-
print "FAIL $msg\n";
309+
$msg = sprintf("FAIL %s\n", $msg);
303310
push @failed,$tstname;
304311
} else {
305-
print SUM "Pass $msg\n";
306-
print "Pass $msg\n";
312+
$msg = sprintf("Pass %s\n", $msg);
307313
push @passed,$tstname;
308-
} close SUM;
314+
}
315+
316+
open (SUM,">> $report");
317+
print SUM $msg;
318+
close SUM;
319+
print $msg;
309320
## }}}
321+
322+
exit 0;
310323
## }}}
311324
} else {
312325
## Report that the simulation failed to build
@@ -360,7 +373,21 @@ ($)
360373
open(TL, $testlist);
361374
while($line = <TL>) {
362375
next if ($line =~ /^\s*#/);
376+
377+
if ($ntasks >= $maxtasks) {
378+
if (waitpid(-1,0) eq 0) {
379+
$ntasks = 0;
380+
} else {
381+
$ntasks = $ntasks - 1;
382+
}
383+
}
384+
363385
simline($line);
386+
$ntasks = $ntasks + 1;
387+
}
388+
389+
while(waitpid(-1,0) gt 0) {
390+
;
364391
}
365392

366393
open(SUM,">> $report");
@@ -371,6 +398,10 @@ ($)
371398
$line = gettest($akey);
372399
next if ($line =~ /FAIL/);
373400
simline($line);
401+
402+
while(waitpid(-1,0) gt 0) {
403+
;
404+
}
374405
}
375406
}
376407
## }}}

0 commit comments

Comments
 (0)