Skip to content

Commit

Permalink
Merge pull request #17 from jrefice/official_patch_2
Browse files Browse the repository at this point in the history
Applying changes for patch 2
  • Loading branch information
jrefice authored Sep 3, 2024
2 parents e815703 + 10a446f commit c5836fd
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 30 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ If data is packed to a stream and then that stream is unpacked, all library vers

Prior to 1800.2 versions, user code could create an instance of uvm_sequence_base or uvm_sequence#(), but because these are abstract in 1800.2, they may no longer be instanced. The recommendation is to use the uvm_compat_sequence_proxy_sequence#(). Please refer to the compatibility package [README](./compat/README.md) for details.

### `uvm_deprecated_defines.svh` and associated macros have been removed

Prior to 1800.2 versions, the file `src/macros/uvm_deprecated_defines.svh` existed and presented transitional macros for users converting from OVM, such as `` `uvm_sequencer_utils(TYPE) ``. This file has been removed and its macros are no longer supported.

## Polling mechansim.
The Polling mechanism is a new feature under development. Hence the API may change. It is experimental and feedback is welcome.
To use this feature, add the define UVM_ENABLE_EXPERIMENTAL_POLLING_API to include the polling API in your compilation. This is in addition to other defines described below which select options within the polling API.
Expand Down
61 changes: 36 additions & 25 deletions src/base/uvm_event.svh
Original file line number Diff line number Diff line change
Expand Up @@ -281,36 +281,35 @@ endclass
// @uvm-ieee 1800.2-2020 auto 10.1.2.1
class uvm_event#(type T=uvm_object) extends uvm_event_base;

typedef uvm_event#(T) this_type;
typedef uvm_event_callback#(T) cb_type;

// Type: cbs_type
// Callback typedef for this event type.
//
// | typedef uvm_callbacks#(this_type, cb_type) cbs_type;
// @uvm-contrib Potential Contribution to 1800.2
typedef uvm_callbacks#(this_type, cb_type) cbs_type;
typedef uvm_event#(T) this_type;
typedef uvm_event_callback#(T) cb_type;

// Type: cbs_type
// Callback typedef for this event type.
//
// | typedef uvm_callbacks#(this_type, cb_type) cbs_type;
// @uvm-contrib Potential Contribution to 1800.2
typedef uvm_callbacks#(this_type, cb_type) cbs_type;

// Not using `uvm_register_cb(this_type, cb_type)
// so as to try and get ~slightly~ better debug
// output for names.
static local function bit m_register_cb();
return uvm_callbacks#(this_type,cb_type)::m_register_pair(
"uvm_pkg::uvm_event#(T)",
"uvm_pkg::uvm_event_callback#(T)"
);
// Not using `uvm_register_cb(this_type, cb_type)
// so as to try and get ~slightly~ better debug
// output for names.
static local function bit m_register_cb();
return cbs_type::m_register_pair("uvm_pkg::uvm_event#(T)",
"uvm_pkg::uvm_event_callback#(T)"
);
endfunction : m_register_cb
static local bit m_cb_registered = m_register_cb();
static local bit m_cb_registered = m_register_cb();

`uvm_object_param_utils(this_type)
`uvm_object_param_utils(this_type)

// Better type name for debug
virtual function string get_type_name();
return "uvm_pkg::uvm_event#(T)";
// Better type name for debug
virtual function string get_type_name();
return "uvm_pkg::uvm_event#(T)";
endfunction : get_type_name

local T trigger_data;
local T default_data;
local T default_data;

// Function -- NODOCS -- new
//
Expand All @@ -327,8 +326,8 @@ class uvm_event#(type T=uvm_object) extends uvm_event_base;

virtual function void reset (bit wakeup = 0);
trigger_data = get_default_data();
super.reset(wakeup);
endfunction : reset
super.reset(wakeup);
endfunction : reset

// Task -- NODOCS -- wait_trigger_data
//
Expand Down Expand Up @@ -485,4 +484,16 @@ class uvm_event#(type T=uvm_object) extends uvm_event_base;
end
endfunction

// @uvm-compat - Added for compatibility with UVM 1.2.
virtual function void add_callback(cb_type cb, bit append=1);
uvm_apprepend ordering;
ordering = (append) ? UVM_APPEND : UVM_PREPEND;
cbs_type::add(this, cb, ordering);
endfunction

// @uvm-compat - Added for compatibility with UVM 1.2.
virtual function void delete_callback(cb_type cb);
cbs_type::delete(this, cb);
endfunction

endclass
5 changes: 4 additions & 1 deletion src/base/uvm_report_object.svh
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ class uvm_report_object extends uvm_object;
return 1;
endfunction


// @uvm-compat - Added for compatibility with 1.2
function uvm_report_server get_report_server();
return uvm_report_server::get_server();
endfunction


endclass
Expand Down
2 changes: 1 addition & 1 deletion src/base/uvm_root.svh
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,8 @@ function void uvm_root::m_do_verbosity_settings();

foreach(m_time_settings[i]) begin
uvm_component comps[$];
find_all(m_time_settings[i].comp,comps);
#(m_time_settings[i].offset - last_time);
find_all(m_time_settings[i].comp,comps);
last_time = m_time_settings[i].offset;
if(m_time_settings[i].id == "_ALL_") begin
foreach(comps[j]) begin
Expand Down
7 changes: 5 additions & 2 deletions src/base/uvm_transaction.svh
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ virtual class uvm_transaction extends uvm_object;
local uvm_tr_stream stream_handle;
local uvm_recorder tr_recorder;

// @uvm-compat - Added for compatibility with 1.2.
uvm_event#(uvm_object) begin_event;
// @uvm-compat - Added for compatibility with 1.2.
uvm_event#(uvm_object) end_event;

endclass


Expand Down Expand Up @@ -810,7 +815,6 @@ function int uvm_transaction::m_begin_tr (time begin_time=0,
do_begin_tr(); //execute callback before event trigger

begin
uvm_event#(uvm_object) begin_event ;
begin_event = events.get("begin");
begin_event.trigger();
end
Expand Down Expand Up @@ -842,7 +846,6 @@ function void uvm_transaction::end_tr (time end_time=0, bit free_handle=1);
tr_recorder = null;

begin
uvm_event#(uvm_object) end_event ;
end_event = events.get("end") ;
end_event.trigger();
end
Expand Down
89 changes: 88 additions & 1 deletion src/macros/uvm_printer_defines.svh
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,93 @@ begin \
PRINTER.print_array_footer(VALUE.num()); \
end


// @uvm-compat - For compatibility with 1.2
`define uvm_print_int3(F, R, P) \
`uvm_print_int(F, $bits(F), R, , P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_int4(F, R, NM, P) \
`uvm_print_named_int(NM, F, $bits(F), R, , P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_object2(F, P) \
`uvm_print_object(F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_string2(F, P) \
`uvm_print_string(F, P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_array_int3(F, R, P) \
`uvm_print_array_int(F, R, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_array_int3(F, R, P) \
`uvm_print_named_qda_int(da, `"F`", F, R, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_sarray_int3(F, R, P) \
`uvm_print_named_qda_int(sa, `"F`", F, R, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_qda_int4(F, R, P, T) \
`uvm_print_named_qda_int(T, `"F`", F, R, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_queue_int3(F, R, P) \
`uvm_print_named_qda_int(queue, `"F`", F, R, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_array_object3(F, P, FLAG) \
`uvm_print_array_object(F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_sarray_object3(F, P,FLAG) \
`uvm_print_sarray_object(F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_object_qda4(F, P, T, FLAG) \
`uvm_print_named_qda_object(T, `"F`", F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_object_queue3(F, P, FLAG) \
`uvm_print_queue_object(F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_array_string2(F, P) \
`uvm_print_array_string(F, P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_sarray_string2(F, P) \
`uvm_print_sarray_string(F, P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_string_qda3(F, P, T) \
`uvm_print_named_qda_string(T, `"F`", F, P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_string_queue2(F, P) \
`uvm_print_queue_string(F, P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_aa_string_int3(F, R, P) \
`uvm_print_aa_int_string(F, R, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_aa_string_object3(F, P, FLAG) \
`uvm_print_aa_object_string(F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_aa_string_string2(F, P) \
`uvm_print_aa_string_string(F, P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_aa_int_object3(F, P, FLAG) \
`uvm_print_aa_object_int(F, ,P)

// @uvm-compat - For compatibility with 1.2
`define uvm_print_aa_int_key4(KEY, F, R, P) \
`uvm_print_aa_int_int(F, R, ,KEY, P)

`endif // `ifndef UVM_PRINTER_DEFINES_SVH

0 comments on commit c5836fd

Please sign in to comment.