Skip to content

Commit 9d25e09

Browse files
update timescale (#238)
update timescale - Removed system_project level option to change simulation timescale - Updated logger to print ps time as fraction to ns for more accurate logging - Added logger time format option - Added a global timescale directive to avoid any warnings - Added timeunit and timeprecision to each test program - Removed time scale and precision related commands - Updated test programs to support new time scaling Signed-off-by: Istvan-Zsolt Szekely <istvan.szekely@analog.com>
1 parent 047a05e commit 9d25e09

File tree

78 files changed

+261
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+261
-216
lines changed

library/drivers/common/watchdog.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ package watchdog_pkg;
8888
@this.stop_event;
8989
join_any
9090
disable fork;
91-
this.info($sformatf("Watchdog timer reset. %s", this.message), ADI_VERBOSITY_MEDIUM);
91+
this.info($sformatf("Watchdog timer reset."), ADI_VERBOSITY_MEDIUM);
9292
end
9393
join_none
9494
endtask: start

library/utilities/logger_pkg.sv

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ package logger_pkg;
5151
input adi_verbosity_t msgVerborisity);
5252

5353
if (verbosity >= msgVerborisity) begin
54-
$display("[INFO] @ %0t: %s", $time, inStr);
54+
$display("[INFO] @ %0t: %s", $realtime, inStr);
5555
end
5656
endfunction: PrintInfo
5757

@@ -69,6 +69,22 @@ package logger_pkg;
6969

7070
function void setLoggerVerbosity(input adi_verbosity_t value);
7171
verbosity = value;
72+
setLoggerTimeFormat("ns", 3);
7273
endfunction: setLoggerVerbosity
7374

75+
function void setLoggerTimeFormat(
76+
input string format,
77+
input int fraction);
78+
79+
case (format)
80+
"s": $timeformat(0, fraction, " s");
81+
"ms": $timeformat(-3, fraction, " ms");
82+
"us": $timeformat(-6, fraction, " us");
83+
"ns": $timeformat(-9, fraction, " ns");
84+
"ps": $timeformat(-12, fraction, " ps");
85+
"fs": $timeformat(-15, fraction, " fs");
86+
default: `ERROR(("Unsupported format!"));
87+
endcase
88+
endfunction: setLoggerTimeFormat
89+
7490
endpackage

library/utilities/test_harness_env.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ package test_harness_env_pkg;
123123
task sys_reset();
124124
//asserts all the resets for 100 ns
125125
this.sys_rst_vip_if.assert_reset();
126-
#200;
126+
#200ns;
127127
this.sys_rst_vip_if.deassert_reset();
128-
#800;
128+
#800ns;
129129
endtask
130130

131131
endclass

library/vip/amd/axi/axi_definitions.svh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
// ***************************************************************************
3434
// ***************************************************************************
3535

36-
`timescale 1ns/1ps
37-
3836
`ifndef _AXI_DEFINITIONS_SVH_
3937
`define _AXI_DEFINITIONS_SVH_
4038

library/vip/amd/axis/axis_definitions.svh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
// ***************************************************************************
3434
// ***************************************************************************
3535

36-
`timescale 1ns/1ps
37-
3836
`ifndef _AXIS_DEFINITIONS_SVH_
3937
`define _AXIS_DEFINITIONS_SVH_
4038

testbenches/ip/axi_tdd/system_tb.sv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
// ***************************************************************************
3434
// ***************************************************************************
3535

36-
`timescale 1ns/1ps
3736

3837
`include "utils.svh"
3938

testbenches/ip/axi_tdd/tests/test_program.sv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ import `PKGIFY(test_harness, ddr_axi_vip)::*;
4545

4646
program test_program;
4747

48+
timeunit 1ns;
49+
timeprecision 1ps;
50+
4851
//instantiate the environment
4952
test_harness_env #(`AXI_VIP_PARAMS(test_harness, mng_axi_vip), `AXI_VIP_PARAMS(test_harness, ddr_axi_vip)) base_env;
5053

testbenches/ip/axis_sequencers/system_tb.sv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
// ***************************************************************************
3434
// ***************************************************************************
3535

36-
`timescale 1ns/1ps
37-
3836
`include "utils.svh"
3937

4038
module system_tb();

testbenches/ip/axis_sequencers/tests/test_program.sv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ import `PKGIFY(test_harness, dst_axis)::*;
5151

5252
program test_program;
5353

54+
timeunit 1ns;
55+
timeprecision 1ps;
56+
5457
// declare the class instances
5558
test_harness_env #(`AXI_VIP_PARAMS(test_harness, mng_axi_vip), `AXI_VIP_PARAMS(test_harness, ddr_axi_vip)) base_env;
5659
axis_sequencer_environment #(`AXIS_VIP_PARAMS(test_harness, src_axis), `AXIS_VIP_PARAMS(test_harness, dst_axis)) axis_seq_env;

testbenches/ip/base/system_tb.sv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
// ***************************************************************************
3434
// ***************************************************************************
3535

36-
`timescale 1ns/1ps
37-
3836
`include "utils.svh"
3937

4038
module system_tb();

0 commit comments

Comments
 (0)