Macros defined for SVT:
|
|
xactor xact; vmm_xactor_iter xactor_iter = new(name, inst); for (vmm_xactor _xact = xactor_iter.first(); _xact != null; _xact = xactor_iter.next()) if ($cast(xact, _xact)) |
|
|
|
|
|
|
|
Clients wishing to pull in the VMM package manually have a one of option for doing so.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1
|
|
|
|
|
|
|
|
The basic objective of this program is to delave a final block to terminate the SLI license server. Since final blocks cannot exist inside a package, this must be defined external to the SVT package.
This file therefore provides the final block, inside a program, for inclusion in the SVT package files. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(1<<14)
|
|
|
'b000010101010101
|
|
|
[ SVT_BATHTUB_LOWER_WT_DIST(minimum,maximum,sidewallpercent) ] :/ lowerwt, [ SVT_BATHTUB_MIDDLE_WT_DIST(minimum,maximum,sidewallpercent) ] :/ middlewt, [ SVT_BATHTUB_UPPER_WT_DIST(minimum,maximum,sidewallpercent) ] :/ upperwt | |
Creates a 'bathtub' shaped distribution with 'x'% of the (max-min) range as the width of the walls of the bathtub and (100 - 2'x')% of the width of the bottom of the tub; where 'x' equals the value of sidewallpercent (expressed as an integer).
Note: no checks are performed to make sure the bathtub sidewalls do not overlap. |
|
|
minimum : (minimum + (maximum - minimum)/sidewallpercent) | |
Defines the 'lower' portion of a bathtub constraint.
|
|
|
(minimum + ((maximum - minimum)/sidewallpercent)) : (maximum - ((maximum - minimum)/sidewallpercent)) | |
Defines the 'middle' portion of a bathtub constraint.
|
|
|
(maximum - ((maximum - minimum)/sidewallpercent)) : maximum | |
Defines the 'upper' portion of a bathtub constraint.
|
|
|
[ SVT_BIAS_LOWER_WT_DIST(minimum,maximum,biasdivisor) ] :/ lowerwt, [ SVT_BIAS_UPPER_WT_DIST(minimum,maximum,biasdivisor) ] :/ upperwt | |
Creates a 'biased' distribution with 1/biasdivisor of the overall range making up the lower portion of the range and the remainder making up the upper portion of the range.
|
|
|
minimum : (minimum + (maximum - minimum)/biasdivisor) | |
Defines the 'lower' portion of a bias constraint.
|
|
|
(minimum + (maximum - minimum)/biasdivisor) : maximum | |
Defines the 'upper' portion of a bias constraint.
|
|
|
'h1000000
|
|
|
vmm_broadcast
|
|
|
protected T callbacks[$]; function void prepend_callback(T cb); foreach (this.callbacks[i]) begin if (this.callbacks[i] == cb) begin `ifdef VMM_LOG_FORMAT_FILE_LINE if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV, `__FILE__, `__LINE__)) begin `else if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV)) begin `endif void'(log.text("Callback has already been registered")); log.end_msg(); end return; end end this.callbacks.push_front(cb); endfunction: prepend_callback function void append_callback(T cb); foreach (this.callbacks[i]) begin if (this.callbacks[i] == cb) begin `ifdef VMM_LOG_FORMAT_FILE_LINE if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV, `__FILE__, `__LINE__)) begin `else if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV)) begin `endif void'(log.text("Callback has already been registered")); log.end_msg(); end return; end end this.callbacks.push_back(cb); endfunction: append_callback function void unregister_callback(T cb); foreach (this.callbacks[i]) begin if (this.callbacks[i] == cb) begin this.callbacks.delete(i); return; end end `ifdef VMM_LOG_FORMAT_FILE_LINE if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV, `__FILE__, `__LINE__)) begin `else if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV)) begin `endif void'(log.text("Callback was not registered")); log.end_msg(); end endfunction: unregister_callback |
|
|
vmm_channel(T) | |
Rely on VMM for the basic channel template
|
|
|
vmm_channel
| |
Use vmm_channel as the basic channel definition
|
|
|
channel.log.get_instance() | |
Macro that can be used to get the instance name for the channel
|
|
|
500
|
|
|
1007
|
|
|
1005
|
|
|
1011
|
|
|
1001
|
|
|
1000
| |
Values (constants) used as arguments for commands utilizing a severity argument
|
|
|
2
|
|
|
0
|
|
|
0
|
|
|
2
|
|
|
1008
| |
Values (constants) used as arguments for commands utilizing a verbosity argument
|
|
|
1003
|
|
|
1009
|
|
|
-1
| |
Null handle which can be used to indicate that a data search should take place at the top level object, and not a contained object
|
|
|
3
|
|
|
-2
| |
Reset handle which can be used to indicate that a reset has taken place and that the testbench should update in accordance with this event.
|
|
|
1
|
|
|
1
|
|
|
1004
|
|
|
1010
|
|
|
1006
|
|
|
1012
|
|
|
1002
|
|
|
7
|
|
|
4
|
|
|
2
|
|
|
6
|
|
|
5
|
|
|
0
|
|
|
3
|
|
|
1
|
|
|
9
|
|
|
vmm_consensus
|
|
|
"SV"
|
|
|
evname = this.notify.configure(, vmm_notify::evtype); | |
Macro used to create a notification event instance for the current methodology
|
|
|
begin svt_notify _notify; void'($cast(_notify, evowner.notify)); evowner.evname = _notify.configure_named_notify(SVT_DATA_UTIL_ARG_TO_STRING(evname), , vmm_notify::evtype); end | |
Macro used to create a named notification event instance for the current methodology
|
|
|
evname = evpool.configure(, vmm_notify::evtype); | |
Macro used to create a notification event instance in the indicated pool for the current methodology
|
|
|
vmm_data
|
|
|
vmm_data
|
|
|
byte_pack
|
|
|
byte_unpack
|
|
|
copy
|
|
|
display(prefix)
|
|
|
display
|
|
|
get_object_hiername
|
|
|
get_name
|
|
|
svt_data_iter
|
|
|
log
|
|
|
vmm_data_member_begin(class_type) |
|
|
svt_vmm_data_member_end(class_type) |
|
|
vmm
|
|
|
VMM
|
|
|
vmm_data_member_begin(class_type) |
|
|
svt_data_param_member_begin(class_type) | |
Macro setup to match 'special capability' macros in UVM/OVM. Just provides basic parameterized class functionality in VMM.
|
|
|
psdisplay(prefix)
|
|
|
psdisplay
|
|
|
notify
|
|
|
svt_notify
|
|
|
svt_data_queue_iter
|
|
|
svt_data_queue
|
|
|
|
svt_data
|
|
|
`"str`"
|
|
|
8
|
|
|
|
|
1
|
|
|
4
|
|
|
8
|
|
|
8
|
|
|
8
|
|
|
8
|
|
|
" |
|
|
vmm_debug(log, $sformatf("%s() - %s", id, msg)) |
|
|
|
|
2
|
|
|
|
|
int current_method_triggered_counter[string]; function bit has_user_cb(); `ifdef SVT_VMM_TECHNOLOGY for (int i = 0; (!has_user_cb && (i < compinst.callbacks.size())); i++) begin svt_xactor_callback svt_cb; if ($cast(svt_cb, compinst.callbacks[i])) has_user_cb = compinst.is_user_cb(svt_cb.get_name()); else /* Its not a SNPS callback, so must be a user callback. */ has_user_cb = 1; end `elsif SVT_UVM_TECHNOLOGY uvm_callback_iter#(T, CB) cb_iter = new(compinst); CB cb = cb_iter.first(); has_user_cb = 0; while (!has_user_cb && (cb != null)) begin has_user_cb = compinst.is_user_cb(cb.get_type_name()); cb = cb_iter.next(); end `elsif SVT_OVM_TECHNOLOGY ovm_callbacks#(T, CB) cbs = ovm_callbacks #(T,CB)::get_global_cbs(); ovm_queue#(CB) cbq = cbs.get(compinst); has_user_cb = 0; for (int i = 0; !has_user_cb && (cbq != null) && (i < cbq.size()); i++) begin CB cb = cbq.get(i); has_user_cb = compinst.is_user_cb(cb.get_type_name()); end `endif endfunction function string get_debug_opts_full_name(); get_debug_opts_full_name = compinst.SVT_DATA_GET_OBJECT_HIERNAME(); endfunction function bit is_debug_enabled(); is_debug_enabled = compinst.get_is_debug_enabled(); endfunction | |
This macro needs to be called by all classes that do callback logging in order to support logging. It should be called within the class declaration, so that the method is available to all cb_exec methods which are implemented within the class.
T -- The component type that the callbacks are registered with. CB -- The callback type that is registered with the component. compinst -- The component instance which the callbacks will be directed through, and which contains a valid 'is_user_cb' (i.e., typically inherited from the SVT component classes) implementation. |
|
|
"svt_debug.out"
|
|
|
"svt_model_log.fsdb"
|
|
|
"svt_debug.transcript"
|
|
|
vmm_log::DEBUG_SEV
|
|
|
'h2000000
|
|
|
int evname; | |
Macro used to declare a notification event instance for the current methodology
|
|
|
'h400
|
|
|
0
| |
Values (constants) representing levels of recursion.
|
|
|
'b000000101010101
|
|
|
7
|
|
|
|
|
0.000001
|
|
|
begin integer sig_depth = 0; $fwrite(mcd_log_file, "# P %0d I %0d name %0d %0d %0d %s %s\n", port_number, width, in_signal_type, in_skew, sig_depth, ifName, clkName); end |
|
|
begin integer sig_depth = 0; integer xTime = 0; $fwrite(mcd_log_file, "# P %0d X %0d name %0d %0d %0d %0d %0d %0d %s %s\n", port_number, width, in_signal_type, out_signal_type, in_skew, out_skew, xTime, sig_depth, ifName, clkName); end |
|
|
begin integer sig_depth = 0; $fwrite(mcd_log_file, "# P %0d O %0d name %0d %0d %0d %s %s\n", port_number, width, out_signal_type, out_skew, sig_depth, ifName, clkName); end |
|
|
0
|
|
|
0
| |
Logging support: Used to log input port changes
|
|
|
1
|
|
|
1
|
|
|
svt_vmm_do_callbacks(T,CB,METHOD) |
|
|
svt_vmm_do_obj_callbacks(T,CB,OBJ,METHOD) |
|
|
'h8000000
|
|
|
if (testpass) errchk.pass(chkstats); else errchk.fail(chkstats,failmsg,faileffect); | |
Macro that can be used to execute a check, but allows for the deferral of the formatting of 'failmsg'
|
|
|
SVT_ERR_CHECK_EXECUTE(errchk,chkstats,testpass,failmsg,svt_err_check_stats::DEFAULT) |
|
|
SVT_ERR_CHECK_STATS_COV_PREFIX_EXTENDED_CLASS_DECL(svt,statsname) | |
This macro is provided for backwards compatibility. Clients should now use the SVT_ERR_CHECK_STATS_COV_PREFIX_EXTENDED_CLASS_DECL macro to avoid class name conflicts.
|
|
|
SVT_ERR_CHECK_STATS_COV_PREFIX_EXTENDED_CLASS_OVERRIDE(svt,statsname) | |
This macro is provided for backwards compatibility. Clients should now use the SVT_ERR_CHECK_STATS_COV_PREFIX_EXTENDED_CLASS_OVERRIDE macro to avoid class name conflicts.
|
|
|
/** Class declaration of error check stats coverage instance for the protocol check statsname */ class suiteprefix``_err_check_stats_cov_``statsname extends svt_err_check_stats_cov; `ifdef SVT_VMM_TECHNOLOGY `ifndef SVT_PRE_VMM_12 `vmm_typename(suiteprefix``_err_check_stats_cov_``statsname) `endif `endif `ifndef SVT_ERR_CHECK_STATS_COV_EXCLUDE_STATUS_CG covergroup status; option.per_instance = 1; option.goal = 100; pass : coverpoint status_bit iff (enable_pass_cov) { bins pass = {1}; `ifdef SVT_MULTI_SIM_IGNORE_BINS `ifndef SVT_ERR_CHECK_STATS_COV_DISABLE_IGNORE_BINS ignore_bins pass_i = {(enable_pass_cov == 1'b0) ? 1'b1 : 1'b0}; `endif `else ignore_bins pass_i = {1} iff (!enable_pass_cov); `endif } fail : coverpoint !status_bit iff (enable_fail_cov) { bins fail = {1}; `ifdef SVT_MULTI_SIM_IGNORE_BINS `ifndef SVT_ERR_CHECK_STATS_COV_DISABLE_IGNORE_BINS ignore_bins fail_i = {(enable_fail_cov == 1'b0) ? 1'b1 : 1'b0}; `endif `else ignore_bins fail_i = {1} iff (!enable_fail_cov); `endif } endgroup `endif extern function new(string name = ""); `ifndef SVT_VMM_TECHNOLOGY `svt_xvm_object_utils(suiteprefix``_err_check_stats_cov_``statsname) `endif `ifdef SVT_VMM_TECHNOLOGY `ifndef SVT_PRE_VMM_12 extern virtual function suiteprefix``_err_check_stats_cov_``statsname allocate(); extern virtual function suiteprefix``_err_check_stats_cov_``statsname copy(); `endif `endif extern virtual function void sample_status(bit status_bit, string message = ""); extern virtual function void set_unique_id(string unique_id); extern static function void override(string inst_path); extern static function void direct_override(svt_err_check_stats stats); `ifdef SVT_VMM_TECHNOLOGY `ifndef SVT_PRE_VMM_12 `vmm_class_factory(suiteprefix``_err_check_stats_cov_``statsname) `endif `endif endclass function suiteprefix``_err_check_stats_cov_``statsname::new(string name = ""); super.new(name, 0); /* If client has disabled pass/fail coverage, then don't create the covergroup */ if ((svt_err_check_stats_cov::initial_enable_pass_cov != 0) || (svt_err_check_stats_cov::initial_enable_fail_cov != 0)) begin `ifndef SVT_ERR_CHECK_STATS_COV_EXCLUDE_STATUS_CG status = new(); `ifdef SVT_ERR_CHECK_STATS_COV_DISABLE_IGNORE_BINS /* NOTE: Some older versions of Incisive (i.e., prior to 12.10.005) require the goal to */ /* be a constant if it is set in the covergroup definition. So set it here instead. */ status.option.goal = 50*(enable_pass_cov+enable_fail_cov); `endif `endif `ifndef SVT_MULTI_SIM_COVERAGE_IFF_SHAPING shape_cov(); `endif end endfunction `ifdef SVT_VMM_TECHNOLOGY `ifndef SVT_PRE_VMM_12 function suiteprefix``_err_check_stats_cov_``statsname suiteprefix``_err_check_stats_cov_``statsname::allocate(); allocate = new(this.get_object_name()); endfunction function suiteprefix``_err_check_stats_cov_``statsname suiteprefix``_err_check_stats_cov_``statsname::copy(); copy = new(this.get_object_name()); copy.set_enable_pass_cov(this.enable_pass_cov); copy.set_enable_fail_cov(this.enable_fail_cov); endfunction `endif `endif function void suiteprefix``_err_check_stats_cov_``statsname::sample_status(bit status_bit, string message = ""); this.status_bit = status_bit; `ifndef SVT_ERR_CHECK_STATS_COV_EXCLUDE_STATUS_CG status.sample(); `endif endfunction function void suiteprefix``_err_check_stats_cov_``statsname::set_unique_id(string unique_id); `ifndef SVT_ERR_CHECK_STATS_COV_EXCLUDE_STATUS_CG /* Make sure the unique_id doesn't have any spaces in it -- otherwise get warnings */ `SVT_DATA_UTIL_REPLACE_PATTERN(unique_id," ", "_"); status.set_inst_name({unique_id,"_status"}); `endif endfunction function void suiteprefix``_err_check_stats_cov_``statsname::override(string inst_path); `ifdef SVT_VMM_TECHNOLOGY `ifndef SVT_PRE_VMM_12 /* Set initial pass/fail cov values to 0, since VMM is going to create a dummy instance and we don't want a dummy covergroup */ svt_err_check_stats_cov::initial_enable_pass_cov = 0; svt_err_check_stats_cov::initial_enable_fail_cov = 0; svt_err_check_stats_cov::override_with_new(inst_path, suiteprefix``_err_check_stats_cov_``statsname::this_type(),shared_log); svt_err_check_stats_cov::override_with_copy(inst_path, suiteprefix``_err_check_stats_cov_``statsname::this_type(),shared_log); /* Restore the initial pass/fail cov values to their favored defaults */ svt_err_check_stats_cov::initial_enable_pass_cov = 0; svt_err_check_stats_cov::initial_enable_fail_cov = 1; `endif `else svt_err_check_stats_cov::type_id::set_inst_override(suiteprefix``_err_check_stats_cov_``statsname::get_type(),inst_path); `endif endfunction function void suiteprefix``_err_check_stats_cov_``statsname::direct_override(svt_err_check_stats stats); `ifdef SVT_VMM_TECHNOLOGY `ifndef SVT_PRE_VMM_12 suiteprefix``_err_check_stats_cov_``statsname factory = null; /* Set initial pass/fail cov values to 0, since VMM is going to create a dummy instance and we don't want a dummy covergroup */ svt_err_check_stats_cov::initial_enable_pass_cov = 0; svt_err_check_stats_cov::initial_enable_fail_cov = 0; factory = new(); stats.register_cov_override(factory); /* Restore the initial pass/fail cov values to their favored defaults */ svt_err_check_stats_cov::initial_enable_pass_cov = 0; svt_err_check_stats_cov::initial_enable_fail_cov = 1; `endif `else stats.register_cov_override(suiteprefix``_err_check_stats_cov_``statsname::get_type()); `endif endfunction | |
This macro declares a class by the name The resulting class is extended from the svt_err_check_stats_cov.sv class. This class includes its own base class covergroup definition, as well as "allocate", "copy", "sample_status", and "set_unique_id" methods, which pertain to the "status" covergroup. It relies on an additional "override" strategy which involves a call to svt_err_check_stats :: register_cov_override. This call establishes an object wrapper for the svt_err_check_stats_cov class extension so that it can be used to create the new class type coverage is added to the svt_err_check_stats instance. Usage of the "override" method: 1. User creates the svt_err_check_stats class instance. 2. Calls the "register_check" method for the check. 3. Call the svt_err_check_stats :: register_cov_override method with an object wrapper for the svt_err_check_stats_cov class instance which provides the overide. Note that the override should normally be done by using the SVT_ERR_CHECK_STATS_COV_PREFIX_EXTENDED_CLASS_OVERRIDE macro. |
|
|
suiteprefix``_err_check_stats_cov_``statsname::direct_override(statsname); | |
Macro that can be used to setup the class override for a specific svt_err_check_stats class instance, identified by statsname, to use the corredponding coverage class defined using the SVT_ERR_CHECK_STATS_COV_PREFIX_EXTENDED_CLASS_DECL macro. Note that this macro relies on the statsname being used for both the 'check_id_str' provided to the original svt_err_check_stats constructor, as well as the name given to the svt_err_check_stats instance in the local scope.
|
|
|
|
vmm_error(log, $sformatf("%s() - %s", id, msg)) |
|
|
|
|
5
|
|
|
|
|
vmm_log::ERROR_SEV
|
|
|
evowner.notify.is_on(evowner.evname) | |
Macro used to check the is_on state for a notification event in the current methodology.
|
|
|
evowner.notify.status(evowner.evname) | |
Macro used to use the notification event accessor function for the current methodology to retrieve the status for the notification event
|
|
|
((excep_list1 != null) && (excep_list1.num_exceptions != 0) && (!excep_list1.enable_combine) && (except_list2 != null) && (!except_list2.enable_combine)) | |
Does the appropriate logical compares to determine if 2 exception lists are NOT allowed to be merged/combined. Expected 'general' usage is shown below.
if (excep2_list == null) `svt_verbose("randomize_*_exception_list", "is null, no exceptions will be generated."); else if `SVT_EXCEPTION_LIST_COMBINE_NOT_OK(excep_list1,except_list2) begin `svt_verbose("randomize_*_exception_list", "cannot be combined with end else begin // Logic to do the randomization of the exceptions to be added // and then combine the two lists. // // If one list has (enable_combine == 1) then the final exception_list // is to have (enable_combine == 1) also. end |
|
|
6
|
|
|
|
|
vmm_fatal(log, $sformatf("%s() - %s", id, msg)) |
|
|
|
|
vmm_log::FATAL_SEV
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Not avaliable yet - please define a VMM automation macro for me |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
256
|
|
|
256
|
|
|
1
|
|
|
1
|
|
|
0
|
|
|
begin $cast(_fsm, create_fsm(T::__type::get(), _name)); end | |
|
|
begin $cast(_st, m_create_state(T::__type::get())); _st.set_fsm(this); end | |
|
|
protected virtual function void m_incoming_states(ref svt_fsm_state_base state_q[$]); svt_fsm_state_base new_q[$] = _st; super.m_incoming_states(state_q); state_q = {state_q, new_q}; endfunction | |
Short-hand macro for defining the set of states than can transition into this state. Simply appends the specified array litteral of states to the list of incoming states specified by the base class. Must be specified within the state definition class, instead of explicitly implementing the svt_fsm_state_base :: m_incoming_states method.
|
|
|
`svt_type_factory_item(__T, svt_fsm_state_base) virtual function string get_class_name(); return SVT_DATA_UTIL_ARG_TO_STRING(__T); endfunction | |
Automatically include the required support code for the specified FSM state type. Must be called in the FSM state class.
|
|
|
The following define is provided to let clients know that this version of the FSM implementation includes support for different transition options, as defined by svt_fsm_state_base :: state_transition_options_enum. Prior to these options being available the only supported transition choice was svt_fsm_state_base :: EXTERNAL_INTERRUPT_NEXT.
With the addition of these options VIPs can improve their performance by updating to support and utilize the svt_fsm_state_base :: INTERNAL_INTERRUPT_NEXT transition choice. |
|
|
`svt_type_factory_item(__T, svt_fsm) | |
Automatically include the required support code for the specified FSM type. Must be called in the FSM class.
|
|
|
evstatus = svt_event_status(evowner,evname); | |
Macro used to get the notification event status
|
|
|
ison = evowner.notify.is_on(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to check the is_on state for a named notification event in the current methodology.
|
|
|
evstatus = evowner.notify.status(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to get the named notification event status
|
|
|
'h5000000
|
|
|
'h024
|
|
|
'h020
|
|
|
'h004
|
|
|
'h008
|
|
|
'h001
|
|
|
'h009
|
|
|
'h012
|
|
|
'h010
|
|
|
'h002
|
|
|
'h038
|
|
|
'h007
|
|
|
Executing this macro in an interface provides an interface accessible method that can be used to enable fsdb dumping of the interface.
The 'depth' argument can be used to define the depth of dumping which is to be enabled. The expectation is '1' for interfaces without any hierarchy. Hierarchical interfaces should provide a value corresponding to the overall interface depth. |
|
|
`ifdef SVT_FSDB_ENABLE bit enable_signal_log = 0; function void set_enable_signal_log(); enable_signal_log = 1; endfunction `else function void set_enable_signal_log(); /** Provide a no-op that clients can call safely when FSDB not enabled. */ endfunction `endif | |
Calling this macro in an interface or module declares a variable and a method for controlling whether FSDB dumping is enabled. Modules should call this macro directly. Interfaces use will call this macro indirectly when they use call SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING.
|
|
|
/** Full path to this interface or module instance */ string full_name; initial full_name = $sformatf("%m"); /** Simple method for getting the full path for an interface or module. */ function string get_full_name(); get_full_name = full_name; endfunction SVT_IF_UTIL_WAIT_ENABLE_SIGNAL_LOG(triggerpath,depth) | |
Calling this macro in a module or interface adds an initial block that will enable fsdb dumping of the module or interface when the enable_signal_log variable in the object indicated by 'triggerpath' is set. Modules should call this macro directly, in concert with SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING_DECL. Interfaces use this macro indirectly when they call SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING.
The client must set the enable_signal_log value in the object indicated by 'triggerpath' by calling the 'set_enable_signal_log' method on the object when it knows the module or interface dumping is desired. The 'depth' argument can be used to define the depth of dumping which is to be enabled. The expectation is that it will be '1' for all modules and for any interfaces without any hierarchy. Hierarchical interfaces should provide a value corresponding to the overall interface depth. |
|
|
/** Full path to this interface or module instance */ reg [80*8:1] full_name; initial full_name = $sformatf("%m"); /** Simple method for getting the full path for an interface or module. */ function reg [80*8:1] get_full_name(); get_full_name = full_name; endfunction SVT_IF_UTIL_WAIT_ENABLE_SIGNAL_LOG(triggerpath,1) | |
NOTE: The following macro is the same as SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING_IMPL, but has been designed to be acceptable in a VLOG module where verilog2001 syntax is being enforced for all VLOG modules. Note that on Questa we actually just defer to the base SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING_IMPL macro.
Calling this macro in a module adds an initial block that will enable fsdb dumping of the module or interface when the enable_signal_log variable in the object indicated by 'triggerpath' is set. Modules should call this macro directly, in concert with SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING_DECL. The client must set the enable_signal_log value in the object indicated by 'triggerpath' by calling the 'set_enable_signal_log' method on the object when it knows the module or interface dumping is desired. Note that unlike SVT_IF_UTIL_SUPPORT_SIGNAL_LOGGING_IMPL, since this macro is aimed at modules, it does not support a 'depth' option. |
|
|
`ifdef SVT_FSDB_ENABLE initial begin `ifdef QUESTA /* On questa accessing the concatenated string directly results in an 'argument is invalid' message. */ /* So we put '{"+fsdbfile+",SVT_DEBUG_OPTS_FSDB_FILE_NAME}' into a local 'fsdbfile_plus_filename' variable to avoid the error. */ static reg [80*8:1] fsdbfile_plus_filename = {"+fsdbfile+",SVT_DEBUG_OPTS_FSDB_FILE_NAME}; `endif wait(triggerpath``enable_signal_log == 1); `ifdef SVT_IF_UTIL_DISABLE_DEFAULT_FSDB /* Use the 'no_default' switch, available with Verdi 2016.06, to */ /* identify that the DEBUG_OPTS FSDB file should not become the */ /* default for all signal storage. This reserves the file for our */ /* interface/module signal information, and ensures that the user */ /* signal information is excluded. */ $fsdbDumpfile(SVT_DEBUG_OPTS_FSDB_FILE_NAME, "+no_default"); `endif `ifdef QUESTA $fsdbDumpvars(depth,$sformatf("%m"),"+all",fsdbfile_plus_filename); `else $fsdbDumpvars(depth,$sformatf("%m"),"+all",{"+fsdbfile+",SVT_DEBUG_OPTS_FSDB_FILE_NAME}); `endif end `endif | |
Utility macro used to setup an initial block to initiate FSDB signal logging once the client specified trigger has been fired. Acts as a no-op if FSDB support not enabled.
|
|
|
0
| |
Constants used to indicate the pass or fail effect for a check..
|
|
|
DEPRECATED: The original error check constants, stated in terms of fail, but used for both pass and fail.
|
|
|
svt_note(id, msg) |
|
|
This macro is used to flag issues which we want to catch during internal development, but which we are willing to live with at the customer site. In these situations its an 'error' internally, but just a verbose message externally.
|
|
|
|
This macro is used to flag issues which we want to catch during internal development, but which we are willing to live with at the customer site. In these situations its a 'warning' internally, but just a verbose message externally.
|
|
|
|
|
if (log != null) begin log.stop_after_n_errors(get_expected_err_cnt() + get_unexpected_err_cnt_max() + SVT_LOG_FORMAT_STOP_AFTER_N_ERRS_BUFFER_AMOUNT); end | |
The following macro is used to push up the vmm_log stop_after_n_errors value in conjunction with updates to the expected_err_cnt and unexpected_err_cnt_max values.
|
|
|
500
| |
The following constant is used to make sure we allow some room between what we flag as "too many errors" and what vmm_log is setup with as "too many errors. This value needs to be fairly large, just in case we produce lots of errors in the process of bringing the system down cleanly. This is only used if we are managing the error count exit.
|
|
|
(DO_ALL & (((value) & SVT_NOPRINT) ? ~DO_PRINT : DO_ALL) & (((value) & SVT_NOCOPY) ? ~DO_COPY : DO_ALL) & (((value) & SVT_NOCOMPARE) ? ~DO_COMPARE : DO_ALL) & (((value) & SVT_NOPACK) ? ~(DO_PACK|DO_UNPACK) : DO_ALL)) |
|
|
1024
|
|
|
real'('hFFFF_FFFF)
|
|
|
4
|
|
|
3
|
|
|
9
|
|
|
8
|
|
|
7
|
|
|
3
|
|
|
4
|
|
|
0
|
|
|
10
|
|
|
5
|
|
|
6
|
|
|
1
|
|
|
2
|
|
|
'h8
|
|
|
'h2
|
|
|
'h3
|
|
|
'h1
|
|
|
'h80
|
|
|
1
| |
Indicates that the attribute operation should 'OR' values.
|
|
|
'h0
|
|
|
'h4
|
|
|
mem_core.get_is_4state()?mem_core.svr_4state.R:mem_core.svr_2state.R
|
|
|
if (mem_core.get_is_4state()) L=mem_core.svr_4state.R; else L=mem_core.svr_2state.R
|
|
|
if (mem_core.get_is_4state()) mem_core.svr_4state.R; else mem_core.svr_2state.R
|
|
|
3
|
|
|
'h40
|
|
|
1
|
|
|
0
| |
Constants for the compare options supported by backdoor classes
|
|
|
2
|
|
|
1'b0
|
|
|
1'b1
|
|
|
1'b0
|
|
|
1'b1
|
|
|
svt_mem class can use this macro to insure the debug messages they produce are filtered based on the 'SVT_MEM_ENABLE_INTERNAL_MESSAGING' define.
|
|
|
43
|
|
|
7
|
|
|
19
|
|
|
36
|
|
|
25
|
|
|
37
|
|
|
4
|
|
|
14
|
|
|
44
|
|
|
20
|
|
|
27
|
|
|
26
|
|
|
10
|
|
|
38
|
|
|
15
|
|
|
45
|
|
|
8
|
|
|
21
|
|
|
28
|
|
|
1
|
|
|
11
|
|
|
39
|
|
|
5
|
|
|
16
|
|
|
22
|
|
|
29
|
|
|
40
|
|
|
17
|
|
|
31
|
|
|
30
|
|
|
2
|
|
|
12
|
|
|
9
|
|
|
23
|
|
|
41
|
|
|
6
|
|
|
18
|
|
|
32
|
|
|
24
|
|
|
34
|
|
|
33
|
|
|
3
|
|
|
13
|
|
|
42
|
|
|
35
|
|
|
'h1
| |
Dump ALL locations in the address range. When not set only the written (i.e., via the bus, a poke, or a load) values will be included in the dump output.
|
|
|
'h10
| |
Append the contents to the existing file if found. For internal use only.
|
|
|
'h4
| |
Exclude the BEGIN from the file output. Used with append when BEGIN not required.
|
|
|
'h8
| |
Exclude the END from the file output. Used with append when END not required.
|
|
|
'h2
| |
Exclude the dump file text header. Note that with MIF this will exclude WIDTH and other settings.
|
|
|
'h8
|
|
|
'h10
|
|
|
3
|
|
|
6
|
|
|
5
|
|
|
2
|
|
|
8
|
|
|
0
|
|
|
7
|
|
|
4
|
|
|
1
|
|
|
0
| |
Constants for the initialize options supported by backdoor classes
|
|
|
2
|
|
|
1
|
|
|
6
|
|
|
'h20
|
|
|
5
|
|
|
3
|
|
|
4
|
|
|
'h4
|
|
|
'h1
| |
Write protect the memory locations in the load file
|
|
|
16
|
|
|
|
|
64
|
|
|
8
|
|
|
1024
|
|
|
|
|
1024
|
|
|
8
|
|
|
'h10
|
|
|
'h02
|
|
|
'h01
|
|
|
'h08
|
|
|
'h20
|
|
|
'h04
|
|
|
'h1
| |
Mask values for to the currently defined system memory manager operations.
|
|
|
'h2
|
|
|
0
|
|
|
1
|
|
|
'h0
|
|
|
'h0003
|
|
|
|
|
|
|
|
|
'hfffffffc
|
|
|
|
|
'h1
|
|
|
'h0002
|
|
|
'h0003
|
|
|
'h0004
|
|
|
'h0001
|
|
|
'h0007
|
|
|
'h0008
|
|
|
'h0006
|
|
|
'h0005
|
|
|
32'h00000010
|
|
|
32'h00000040
|
|
|
32'h00000020
|
|
|
32'h00000001
|
|
|
32'h00000002
|
|
|
32'h00000100
|
|
|
32'h00000200
|
|
|
32'h00080000
|
|
|
32'h00070000
|
|
|
32'h00070000
|
|
|
32'h00010000
|
|
|
32'h00030000
|
|
|
32'h00050000
|
|
|
32'h00040000
|
|
|
32'h00060000
|
|
|
32'h00020000
|
|
|
32'h00100000
|
|
|
32'h00020000
|
|
|
32'h00002000
|
|
|
32'h00040000
|
|
|
32'h00200000
|
|
|
32'h00001000
|
|
|
32'h00010000
|
|
|
32'h00008000
|
|
|
32'h00004000
|
|
|
|
|
|
|
|
|
(SVT_MEM_SA_STATUS_RD_RD_NO_WR | SVT_MEM_SA_STATUS_WR_LOSS | SVT_MEM_SA_STATUS_WR_SAME | SVT_MEM_SA_STATUS_WR_WR | SVT_MEM_SA_STATUS_RD_B4_WR | SVT_MEM_SA_STATUS_WR_PROT | SVT_MEM_SA_STATUS_ADR_ERR | SVT_MEM_SA_STATUS_DATA_ERR | SVT_MEM_SA_STATUS_ACCESS_LOCKED | SVT_MEM_SA_STATUS_ACCESS_ERROR | SVT_MEM_SA_STATUS_PARTIAL_RD | SVT_MEM_SA_STATUS_MISCOMPARE ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'h3
|
|
|
200
|
|
|
'h1
|
|
|
'h3
|
|
|
'h2
|
|
|
'h4
|
|
|
'h3
|
|
|
'h5
|
|
|
'h1
|
|
|
'h0
|
|
|
'h2
|
|
|
64
|
|
|
6
| |
Maximum number of physical addressing dimensions the memserver System Verilog component will handle Set to the maximum currently required by all known memserver clients
|
|
|
1
|
|
|
4
|
|
|
3
|
|
|
2
|
|
|
|
|
|
|
|
|
'h0
|
|
|
|
|
(((m)&SVT_MEM_SA_MODE_COHERENCE_MASK)>>6)
|
|
|
'h000000c0
|
|
|
(((val)&'h3)<<6)
|
|
|
'h00000004
|
|
|
'h00000002
|
|
|
(((m)&SVT_MEM_SA_MODE_SPACE_MASK)>>4)
|
|
|
(((val)&'h3)<<4)
|
|
|
'h00000008
|
|
|
'h00000001
|
|
|
(((m)&SVT_MEM_SA_MODE_SIM_SIZE_MASK)>>8)
|
|
|
'h00000300
|
|
|
(((val)&'h3)<<8)
|
|
|
'h00000030
|
|
|
0
|
|
|
0
|
|
|
2
|
|
|
1
|
|
|
'h1f
|
|
|
6
|
|
|
5
|
|
|
'h80
|
|
|
3
|
|
|
4
|
|
|
1
|
|
|
int unsigned ADDR [SVT_MEM_SA_CORE_PHYSICAL_DIMENSIONS_MAX]
|
|
|
32'h00000200
|
|
|
32'h00000100
|
|
|
32'h00000040
|
|
|
32'h20000000
|
|
|
32'h00000080
|
|
|
|
|
32'h40000000
|
|
|
32'h00000400
|
|
|
32'h80000000
|
|
|
32'h00002000
|
|
|
32'h00004000
|
|
|
32'h00000000
|
|
|
32'h00001000
|
|
|
32'h00000800
|
|
|
32'h00000010
|
|
|
32'h00000001
|
|
|
32'h00000002
|
|
|
32'h00000020
|
|
|
32'h00000004
|
|
|
32'h00000008
|
|
|
|
|
`ifdef SVT_VMM_TECHNOLOGY if (do_what == DO_COMPARE) begin if (!svt_mem_compare_hook(this.__vmm_rhs, this.__vmm_image)) begin this.__vmm_status = 0; end end `endif | |
Add some customized logic to compare the actual memory elements
|
|
|
`ifdef SVT_VMM_TECHNOLOGY if (do_what == DO_COPY) begin svt_mem_copy_hook(this.__vmm_rhs); end `endif | |
Add some customized logic to copy the actual memory elements
|
|
|
|
`define svt___current_suite __suite `define svt___current_vendor __name | |
Short-hand macro to define a suite-specific, vendor-specific catalog class and start populating part entries. May be used multiple times to create multiple catalog "pages".
Assumes the existence of a catalog class named svt_ |
|
|
`undef svt___current_suite `undef svt___current_vendor | |
Short-hand macro for closing a vendor part catalog "page".
|
|
|
svt_mem_vendor_part2(`svt___current_suite, `svt___current_vendor, __name, __descr, __depth, __width, __speed, __cfg) | |
Short-hand macro for defining a vendor part catalog entry. Must be used between `svt_mem_vendor_catalog_begin and
`undef svt___current_suite `undef svt___current_vendor macros |
|
|
svt_``__suite``_vendor_part __name``__in__``__suite``_``__vendor``_catalog = new(svt_``__suite``_vendor_catalog::get_vendor(`"__vendor`"), `"__name`", __descr, SVT_MEM_``__depth, SVT_MEM_``__width, SVT_MEM_``__speed, __cfg); |
|
|
svt_mem class can use this macro to insure the verbose messages they produce are filtered based on the 'SVT_MEM_ENABLE_INTERNAL_MESSAGING' define.
|
|
|
-1
|
|
|
-1
| |
Simple defines to make it easier to write portable FATAL/ERROR/WARNING requests.
|
|
|
svt_message_manager::facilitate_get_client_verbosity_level(prefmgrid,defmgrid) | |
Macro used to get the verbosity for the associated message manager.
|
|
|
-1
|
|
|
0
|
|
|
(1<<3)
|
|
|
(1<<1)
|
|
|
(1<<16)
|
|
|
(1<<9)
|
|
|
(1<<5)
|
|
|
0
|
|
|
vmm_log::NORMAL_SEV
|
|
|
vmm_note(log, $sformatf("%s() - %s", id, msg)) |
|
|
|
|
3
|
|
|
|
|
vmm_notify
|
|
|
if (stateclass.notifyname == 0) begin stateclass.notifyname = stateclass.notify.configure(, notifykind); end else begin svt_fatal(SVT_DATA_UTIL_ARG_TO_STRING(methodname), $sformatf("Attempted to configure notify '%0s' twice. Unable to continue.", SVT_DATA_UTIL_ARG_TO_STRING(notifyname))); end | |
This macro can be used to configure a basic notification, independent of the base technology.
|
|
|
2
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/common.h)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/common.svh)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/common.vi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/common.vih)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/model/bfm/include/common.vi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/model/bfm/include/module.v)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/interface.sv)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/module.v)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/verilog/module.v)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/include/verilog/module.vih)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(suite/src/verilog/module.v)
|
|
|
'h4000000
|
|
|
(1<<13)
|
|
|
|
(1<<16)
|
|
|
'h1000
|
|
|
1
|
|
|
-1
| |
Constants used with operations such as byte_pack, compare, etc., to select the completeness of the action. RELEVANT for protocol specific fields, COMPLETE for all fields.
|
|
|
evowner.notify.reset(evowner.evname); | |
Macro used to reset a notification event in the current methodology
|
|
|
evowner.notify.reset(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to reset a named notification event in the current methodology
|
|
|
'h800
|
|
|
1
|
|
|
"VCS"
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/svt/include/incpkg.pkg)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/svt/include/incpkg.pkg)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/svt/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/svt/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/svt/src/module.sv)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/svt/src/srcsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/include/inclsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/src/module.sv)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/model/src/srcsvi.svi)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/src/module.sv)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite)
|
|
|
SVT_SOURCE_QUOTE_DESIGNWARE_HOME(vip/suite/src/srcsvi.svi)
|
|
|
`"/remote/sdgvips02/rajneesh/svt_rel_client/leafname`"
|
|
|
if (`SVT_STATUS_EVENT_IS_EMPTY(evowner,evname)) begin svt_error(SVT_DATA_UTIL_ARG_TO_STRING(funcname), $sformatf("Notify '%0s' has not been configured. Unable to continue.", SVT_DATA_UTIL_ARG_TO_STRING(evname))); funcname = 0; end | |
This macro can be used to check whether a notification event has been configured.
|
|
|
svt_event_is_on(evowner,evname) | |
Macro used to check the is_on state for a notification event in the current methodology.
|
|
|
svt_event_status(evowner,evname) | |
Macro used to use the event status accessor function for the current methodology to retrieve the status for a notification event
|
|
|
svt_get_event_status(evowner,evname,evstatus) | |
Macro used to get the notification event status
|
|
|
SVT_STATUS_EVENT_CHECK(funcname,this,evname) | |
This macro can be used to check whether a notification event has been configured. NOTE: This is kept around for backwards compatibility -- classes should be moving to SVT_STATUS_EVENT_CHECK.
|
|
|
SVT_STATUS_NOTIFY_CONFIGURE_BASE(methodname,stateclass,notifyname,svt_notify::ON_OFF) | |
This macro can be used to configure a basic notify, as supported by vmm_notify, avoiding redundant configuration of the notify. This macro assumes the client desires an ON/OFF notify.
|
|
|
`ifdef SVT_VMM_TECHNOLOGY if (stateclass.notifyname == 0) begin stateclass.notifyname = stateclass.notify.configure(, notifykind); `else if (stateclass.notifyname == null) begin `SVT_XVM(event_pool) event_pool = stateclass.get_event_pool(); stateclass.notifyname = event_pool.get(SVT_DATA_UTIL_ARG_TO_STRING(notifyname)); `endif end else begin svt_fatal(SVT_DATA_UTIL_ARG_TO_STRING(methodname), $sformatf("Attempted to configure notify '%0s' twice. Unable to continue.", SVT_DATA_UTIL_ARG_TO_STRING(notifyname))); end | |
This base macro can be used to configure a basic notify, as supported by the underlying technology, avoiding redundant configuration of the notify. This macro must be supplied with all pertinent info, including an indication of the notify type.
|
|
|
SVT_STATUS_NOTIFY_CONFIGURE_NAMED_NOTIFY_BASE(methodname,stateclass,notifyname,svt_notify::ON_OFF) | |
This macro can be used to configure a named notify, as supported by svt_notify, avoiding redundant configuration of the notify. This macro assumes the client desires an ON/OFF notify.
|
|
|
`ifdef SVT_VMM_TECHNOLOGY if (stateclass.notifyname == 0) begin `ifdef SVT_MULTI_SIM_LOCAL_STATIC_VARIABLE_WITH_INITIALIZER_REQUIRES_STATIC_KEYWORD svt_notify typed_notify ; typed_notify = stateclass.get_notify(); `else svt_notify typed_notify = stateclass.get_notify(); `endif stateclass.notifyname = typed_notify.configure_named_notify(SVT_DATA_UTIL_ARG_TO_STRING(notifyname), , notifykind); `else if (stateclass.notifyname == null) begin `SVT_XVM(event_pool) event_pool = stateclass.get_event_pool(); stateclass.notifyname = event_pool.get(SVT_DATA_UTIL_ARG_TO_STRING(notifyname)); `endif end else begin svt_fatal(SVT_DATA_UTIL_ARG_TO_STRING(methodname), $sformatf("Attempted to configure notify '%0s' twice. Unable to continue.", SVT_DATA_UTIL_ARG_TO_STRING(notifyname))); end | |
This macro can be used to configure a named notify, as supported by svt_notify, avoiding redundant configuration of the notify.
|
|
|
svt_reset_event(evowner,evname) | |
Macro used to reset a notification event in the current methodology
|
|
|
svt_trigger_copy_data_event(evowner,evname,evdata) | |
Macro used to signal a notification event and corresponding data for the current methodology, but with a 'copy' of the original data
|
|
|
svt_trigger_data_event(evowner,evname,evdata) | |
Macro used to signal a notification event and corresponding data for the current methodology
|
|
|
svt_trigger_event(evowner,evname) | |
Macro used to signal a notification event for the current methodology
|
|
|
svt_wait_event_off(evowner,evname) | |
Macro used to wait for an 'off' a notification event in the current methodology
|
|
|
svt_wait_event_on(evowner,evname) | |
Macro used to wait for an 'on' notification event in the current methodology
|
|
|
svt_wait_event_trigger(evowner,evname) | |
Macro used to wait for a notification event in the current methodology
|
|
|
'h6000000
|
|
|
7
|
|
|
6
|
|
|
0
|
|
|
5
|
|
|
3
|
|
|
2
|
|
|
32'h0000_4000 /* Flush Buffered Message */
|
|
|
32'h0000_FF00
|
|
|
32'h0000_0200 /* Don't display the Log Level */
|
|
|
32'h0000_0400 /* Neither Timestamp nor Log Level are displayed */
|
|
|
32'h0000_0300 /* Neither Timestamp nor Log Level are displayed */
|
|
|
32'h0000_0100 /* Don't display the timestamp */
|
|
|
32'h0000_2000 /* Start Buffered Message */
|
|
|
32'h0000_0800 /* This is a transaction msglog, write to trace file, ignoring log level */
|
|
|
4
|
|
|
1
|
|
|
"shared_svc_msg_mgr"
|
|
|
|
'h7000000
|
|
|
`ifdef SVT_VMM_TECHNOLOGY (timername.notify.is_on(timername.eventname)) `else (timername.eventname.is_on()) `endif | |
Macro used to check the is_on state for a notification event in the current methodology.
|
|
|
`ifdef SVT_VMM_TECHNOLOGY timername.notify.wait_for(timername.evname); `else timername.evname.wait_trigger(); `endif | |
Macro used to wait for a notification event in the current methodology
|
|
|
`ifdef SVT_VMM_TECHNOLOGY timername.notify.wait_for_off(timername.evname); `else timername.evname.wait_off(); `endif | |
Macro used to wait for an 'off' a notification event in the current methodology
|
|
|
`ifdef SVT_VMM_TECHNOLOGY timername.notify.wait_for(timername.evname); `else timername.evname.wait_on(); `endif | |
Macro used to wait for an 'on' notification event in the current methodology
|
|
|
3
|
|
|
15
|
|
|
9
|
|
|
6
|
|
|
18
|
|
|
12
|
|
|
2
|
|
|
14
|
|
|
8
|
|
|
5
|
|
|
17
|
|
|
11
|
|
|
1
|
|
|
13
|
|
|
7
|
|
|
4
|
|
|
16
|
|
|
10
|
|
|
0
| |
Macros defined to represent different timeunit values.
|
|
|
vmm_trace(log, $sformatf("%s() - %s", id, msg)) |
|
|
|
|
vmm_log::TRACE_SEV
|
|
|
4096
|
|
|
4096
|
|
|
4096
|
|
|
64
|
|
|
2
|
|
|
2
|
|
|
1
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
512
|
|
|
1
|
|
|
1
|
|
|
2
|
|
|
0
|
|
|
1
|
|
|
3
|
|
|
svt_data
|
|
|
end_time
|
|
|
vmm_data::ENDED
|
|
|
/** Exception list initiator for classname transaction */ class classname``_exception_list_initiator extends classname; rand classname``_exception_list rand_exception_list; `ifndef SVT_VMM_TECHNOLOGY /** Constructor */ function new(string name=""); super.new(name); endfunction svt_data_member_begin(classname``_exception_list_initiator) svt_data_member_end(classname``_exception_list_initiator) `endif /** pre_randomize method which can be insures rand_exception_list is non-null. */ function void pre_randomize(); super.pre_randomize(); if (this.rand_exception_list == null) this.rand_exception_list = new(); this.rand_exception_list.setup_randomized_exception(this.cfg, this); `ifdef SVT_MULTI_SIM_SKIPPED_PRE_RANDOMIZE this.rand_exception_list.populate_exceptions(); `endif endfunction /** pre_randomize method which removes the exception list if it is empty. */ function void post_randomize(); super.post_randomize(); if ((this.rand_exception_list != null) && (this.rand_exception_list.num_exceptions > 0)) begin this.exception_list = this.rand_exception_list; end else begin /* Clearing this.rand_exception_list can result in warning in some simulators, so leave it. */ /* this.rand_exception_list = null; */ this.exception_list = null; end endfunction endclass | |
Container which automates exception generation for a transaction.
|
|
|
( (start_ix == -1) ? 0 : start_ix ) | |
Macro used to figure out the first available index
|
|
|
( (end_ix == -1) ? SVT_TRANSACTION_ITER_TOP_LEVEL_QUEUE_SIZE-1 : end_ix ) | |
Macro used to figure out the last available index
|
|
|
( (iter_type == IMPLEMENTATION) ? this.iter_xact.implementation.size() : ((iter_type == TRACE) && (this.iter_xact.trace.size() == 0)) ? this.iter_xact.implementation.size() : ((iter_type == TRACE) && ((name_match == null) || scan_name_match_trace)) ? this.iter_xact.trace.size() : ((iter_type == TRACE) && (name_match.get_class_name() != iter_xact.get_class_name())) ? this.iter_xact.trace.size() : (iter_type == TRACE) ? this.iter_xact.implementation.size() : 0 ) | |
Macro used to access the queue size for the proper collection
|
|
|
( (iter_type == IMPLEMENTATION) ? this.iter_xact.implementation[top_level_ix] : ((iter_type == TRACE) && (this.iter_xact.trace.size() == 0)) ? this.iter_xact.implementation[top_level_ix] : ((iter_type == TRACE) && ((name_match == null) || scan_name_match_trace)) ? this.iter_xact.trace[top_level_ix] : ((iter_type == TRACE) && (name_match.get_class_name() != iter_xact.get_class_name())) ? this.iter_xact.trace[top_level_ix] : (iter_type == TRACE) ? this.iter_xact.implementation[top_level_ix] : null ) | |
Macro used to pull the data object from the proper collection
|
|
|
svt_transaction_iter
|
|
|
class class_name``_ms_scenario extends svt_dynamic_ms_scenario; /** Properly typed scenario implementing the details of the scenario. */ rand class_name``_scenario contained_scen; /** Name for the channel associated with this multi-stream scenario. */ string chan_name = ""; /** Indicates whether this scenario should wait for the completion of the transactions generated by the scenario. */ bit throttle = 0; /** Controls how many times the scenario is used. -1 indicates no limit, non-negative values define hard limits. */ int execute_limit = -1; /** Used in conjunction with execute_limit, tracking how many times the scenario has been executed. */ int execute_cnt = 0; /** Setup delay applied prior to initiating the transactions in the scenario. */ real setup = 0.0; /** Minimum setup delay value used to define one end of the range for setup delays. */ real setup_min = 0.0; /** Maximum setup delay value used to define one end of the range for setup delays. */ real setup_max = 0.0; /** Temporary used during randomization to allow the setup delay to be randomized */ rand longint unsigned setup_longint; /** Temporary used ruring randomization to defined the Maximum setup delay. */ longint unsigned setup_min_longint; /** Temporary used ruring randomization to defined the Maximum setup delay. */ longint unsigned setup_max_longint; /** Hold delay, in simulation time units, applied after initiating the transactions in the scenario and waiting for their completion (i.e., if #throttle set to 1). */ real hold = 0.0; /** Minimum hold delay value used to define one end of the range for hold delays. */ real hold_min = 0.0; /** Maximum hold delay value used to define one end of the range for hold delays. */ real hold_max = 0.0; /** Temporary used during randomization to allow the hold delay to be randomized */ rand longint unsigned hold_longint; /** Temporary used ruring randomization to defined the Maximum hold delay. */ longint unsigned hold_min_longint; /** Temporary used ruring randomization to defined the Maximum hold delay. */ longint unsigned hold_max_longint; /** VMM ID associated with this scenario. */ int SCENARIO_ID; /** Defines the weight to be applied to the delays which make up the lower sidewall of the overall delay range. */ int LOWER_DELAY_wt = 1000; /** Defines the weight to be applied to the delays in the middle of the delay range, between the lower and upper sidewalls. */ int MIDDLE_DELAY_wt = 1; /** Defines the weight to be applied to the delays which make up the upper sidewall of the overall delay range. */ int UPPER_DELAY_wt = 100; /** Defines what percentage of the overall delay range which should be set aside for each of the two sidewalls, lower and upper. */ int SIDEWALL_PERCENT = 10; constraint reasonable_scen_length { this.contained_scen.length > 0; } constraint reasonable_setup { this.setup_longint dist { SVT_BATHTUB_DIST(this.setup_min_longint,this.setup_max_longint,LOWER_DELAY_wt,MIDDLE_DELAY_wt,UPPER_DELAY_wt,SIDEWALL_PERCENT) }; } constraint reasonable_hold { this.hold_longint dist { SVT_BATHTUB_DIST(this.hold_min_longint,this.hold_max_longint,LOWER_DELAY_wt,MIDDLE_DELAY_wt,UPPER_DELAY_wt,SIDEWALL_PERCENT) }; } `ifdef SVT_PRE_VMM_11 function new(string chan_name = "", class_name factory = null, class_name``_scenario contained_scen = null, bit throttle = 0); super.new(); `else function new(VMM_SCENARIO parent = null, string chan_name = "", class_name factory = null, class_name``_scenario contained_scen = null, bit throttle = 0); super.new(parent); `endif begin string scen_tag = (contained_scen == null) ? "CONTAINED_ATOMIC_SCENARIO" : "CONTAINED_SCENARIO"; if (contained_scen == null) begin /* Create an atomic scenario as the default scenario */ class_name``_atomic_scenario atomic_scen = new(); this.contained_scen = atomic_scen; end else begin this.contained_scen = contained_scen; end if (factory != null) begin this.contained_scen.using = factory; end this.chan_name = chan_name; this.throttle = throttle; SCENARIO_ID = this.define_scenario(scen_tag,1); this.scenario_kind = SCENARIO_ID; this.length = 1; this.repeated = 0; this.log.is_above(this.contained_scen.log); end endfunction local virtual function string this_class_name(); begin return {SVT_DATA_UTIL_ARG_TO_STRING(class_name), "_ms_scenario"}; end endfunction virtual task execute(ref int n); begin class_name``_channel out_chan; int unsigned n_inst; bit ready_to_apply = 0; bit applied = 0; if (this.execute_limit_exceeded()) begin svt_verbose("execute", $sformatf("The current execute_cnt (%0d) exceeds the execute_limit (%0d). Nothing to execute.", this.execute_cnt, this.execute_limit)); n = 0; end else if (!$cast(out_chan, get_channel(this.chan_name))) begin svt_fatal("execute", $sformatf("The indicated channel (%0s) could not be found or is not of type %0s_channel. Unable to continue.", this.chan_name, SVT_DATA_UTIL_ARG_TO_STRING(class_name))); n = 0; end else if (out_chan == null) begin svt_fatal("execute", $sformatf("The indicated channel (%0s) is null. Unable to continue.", this.chan_name)); n = 0; end else begin svt_verbose("execute", $sformatf("Generated scenario (%0d, %0d) directed at channel %0s", this.stream_id, this.scenario_id, this.chan_name)); if (this.setup > 0) begin `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME svt_verbose("execute", $sformatf("Delaying execution based on setup value of %0f", this.setup)); `else svt_verbose("execute", $sformatf("Delaying execution based on setup value of %0t(%0f)", this.setup, this.setup)); `endif #this.setup; `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME svt_verbose("execute", $sformatf("Execution delay based on setup value of %0f is complete", this.setup)); `else svt_verbose("execute", $sformatf("Execution delay based on setup value of %0t(%0f) is complete", this.setup, this.setup)); `endif end else begin `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME svt_verbose("execute", $sformatf("Setup is %0f, so not delaying execution.", this.setup)); `else svt_verbose("execute", $sformatf("Setup is %0t(%0f), so not delaying execution.", this.setup, this.setup)); `endif end fork begin svt_verbose("execute", $sformatf("About to apply %0d xacts to out_chan %0s for scenario (%0d, %0d).", this.contained_scen.length, this.chan_name, this.stream_id, this.scenario_id)); while (!ready_to_apply) begin @ ready_to_apply; end this.contained_scen.apply(out_chan, n_inst); svt_verbose("execute", $sformatf("Applied %0d xacts to out_chan %0s for scenario (%0d, %0d)", this.contained_scen.length, this.chan_name, this.stream_id, this.scenario_id)); applied = 1; end begin if (this.throttle) begin bit orig_tee_mode = out_chan.tee_mode(1); class_name last; fork begin /* disable fork block */ fork begin while (!applied) begin class_name next; ready_to_apply = 1; svt_verbose("execute", $sformatf("tee'ing next transaction out of out_chan %0s", this.chan_name)); out_chan.tee(next); /* Make sure we see something before attempting to set 'last' */ last = next; svt_verbose("execute", $sformatf("tee'ed transaction from out_chan %0s", this.chan_name)); end end begin svt_verbose("execute", $sformatf("waiting for applied on out_chan %0s", this.chan_name)); @ applied; svt_verbose("execute", $sformatf("waited for applied on out_chan %0s", this.chan_name)); end join_any disable fork; end join_any /* disable fork block */ void'(out_chan.tee_mode(orig_tee_mode)); if ((last != null) && (!last.notify.is_on(vmm_data::ENDED))) begin svt_verbose("execute", $sformatf("waiting for ENDED on last transaction extracted from out_chan %0s", this.chan_name)); last.notify.wait_for(vmm_data::ENDED); svt_verbose("execute", $sformatf("waited for ENDED on last transaction extracted from out_chan %0s", this.chan_name)); end svt_verbose("execute", $sformatf("throttle of out_chan %0s is complete", this.chan_name)); end else begin ready_to_apply = 1; svt_verbose("execute", $sformatf("scenario for out_chan %0s setup with throttle = 0", this.chan_name)); end end join svt_verbose("execute", $sformatf("Applied %0d instances to out_chan %0s", n_inst, this.chan_name)); if (this.hold > 0) begin `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME svt_verbose("execute", $sformatf("Delaying completion based on hold value of %0f", this.hold)); `else svt_verbose("execute", $sformatf("Delaying completion based on hold value of %0t(%0f)", this.hold, this.hold)); `endif #this.hold; `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME svt_verbose("execute", $sformatf("Completion delay based on hold value of %0f is complete", this.hold)); `else svt_verbose("execute", $sformatf("Completion delay based on hold value of %0t(%0f) is complete", this.hold, this.hold)); `endif end else begin `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME svt_verbose("execute", $sformatf("Hold is %0f, so not delaying completion.", this.hold)); `else svt_verbose("execute", $sformatf("Hold is %0t(%0f), so not delaying completion.", this.hold, this.hold)); `endif end n += n_inst; this.execute_cnt++; end end endtask virtual function string psdisplay(string prefix = ""); begin psdisplay = { super.psdisplay(prefix), "\n" }; psdisplay = { psdisplay, prefix, "chan_name = ", this.chan_name, "\n" }; psdisplay = { psdisplay, prefix, $sformatf("throttle = %0b\n", throttle) }; psdisplay = { psdisplay, this.contained_scen.psdisplay(prefix) }; psdisplay = { psdisplay, prefix, $sformatf("SCENARIO_ID = %0d\n", SCENARIO_ID) }; `ifdef SVT_MULTI_SIM_DISPLAY_REAL_AS_TIME psdisplay = { psdisplay, prefix, $sformatf("setup = %0f\n", this.setup) }; psdisplay = { psdisplay, prefix, $sformatf("setup_min = %0f\n", this.setup_min) }; psdisplay = { psdisplay, prefix, $sformatf("setup_max = %0f\n", this.setup_max) }; psdisplay = { psdisplay, prefix, $sformatf("hold = %0f\n", this.hold) }; psdisplay = { psdisplay, prefix, $sformatf("hold_min = %0f\n", this.hold_min) }; psdisplay = { psdisplay, prefix, $sformatf("hold_max = %0f\n", this.hold_max) }; `else psdisplay = { psdisplay, prefix, $sformatf("setup = %0t(%0f)\n", this.setup, this.setup) }; psdisplay = { psdisplay, prefix, $sformatf("setup_min = %0t(%0f)\n", this.setup_min, this.setup_min) }; psdisplay = { psdisplay, prefix, $sformatf("setup_max = %0t(%0f)\n", this.setup_max, this.setup_max) }; psdisplay = { psdisplay, prefix, $sformatf("hold = %0t(%0f)\n", this.hold, this.hold) }; psdisplay = { psdisplay, prefix, $sformatf("hold_min = %0t(%0f)\n", this.hold_min, this.hold_min) }; psdisplay = { psdisplay, prefix, $sformatf("hold_max = %0t(%0f)\n", this.hold_max, this.hold_max) }; `endif psdisplay = { psdisplay, prefix, $sformatf("LOWER_DELAY_wt = %0d\n", LOWER_DELAY_wt) }; psdisplay = { psdisplay, prefix, $sformatf("MIDDLE_DELAY_wt = %0d\n", MIDDLE_DELAY_wt) }; psdisplay = { psdisplay, prefix, $sformatf("UPPER_DELAY_wt = %0d\n", UPPER_DELAY_wt) }; psdisplay = { psdisplay, prefix, $sformatf("SIDEWALL_PERCENT = %0d\n", SIDEWALL_PERCENT) }; end endfunction virtual function vmm_data copy(vmm_data to = null); begin class_name``_ms_scenario cpy = null; if (to == null) begin cpy = new(); end else if (!$cast(cpy, to)) begin svt_fatal("copy", $sformatf("Cannot copy to instance that is not of type %0s", this_class_name())); end if (cpy != null) begin void'(super.copy(cpy)); if (!$cast(cpy.contained_scen,this.contained_scen.copy())) begin svt_fatal("copy", $sformatf("%0s failed attempting to copy contained scenario", this_class_name())); end cpy.chan_name = this.chan_name; cpy.throttle = this.throttle; end return cpy; end endfunction virtual function bit adjust_weights_per_cfg(); adjust_weights_per_cfg = !execute_limit_exceeded(); endfunction function void pre_randomize(); begin this.setup_longint = this.setup; this.setup_min_longint = this.setup_min; this.setup_max_longint = this.setup_max; this.hold_longint = this.hold; this.hold_min_longint = this.hold_min; this.hold_max_longint = this.hold_max; void'(adjust_weights_per_cfg()); /* Make sure the contained scenario info matches the scenario info */ this.contained_scen.stream_id = this.stream_id; this.contained_scen.scenario_id = this.scenario_id; foreach (this.contained_scen.items[i]) begin this.contained_scen.items[i].stream_id = this.contained_scen.stream_id; this.contained_scen.items[i].scenario_id = this.contained_scen.scenario_id; this.contained_scen.items[i].data_id = i; end super.pre_randomize(); end endfunction function void post_randomize(); begin super.post_randomize(); this.setup = this.setup_longint; this.hold = this.hold_longint; end endfunction function bit execute_limit_exceeded(); begin execute_limit_exceeded = (execute_limit >= 0) && (execute_cnt >= execute_limit); end endfunction endclass: class_name``_ms_scenario | |
This macro can be used to create a simple "one channel" multi-stream scenario class which implements its scenario via a contained atomic scenario class.
|
|
|
|
svt_transaction_report
|
|
|
`ifdef SVT_VMM_TECHNOLOGY if (do_what == DO_COPY) begin svt_transaction_copy_hook(this.__vmm_rhs); end `endif | |
Add some customized logic to copy implementation and trace queues
|
|
|
start_time
|
|
|
vmm_data::STARTED
|
|
|
svt_transaction
|
|
|
|
|
evowner.notify.indicate(evowner.evname,evdata.copy()); | |
Macro used to signal a notification event and corresponding data for the current methodology, but with a 'copy' of the original data
|
|
|
evowner.notify.indicate(evowner.evname,evdata); | |
Macro used to signal a notification event and corresponding data for the current methodology
|
|
|
evowner.notify.indicate(evowner.evname); | |
Macro used to signal a notification event for the current methodology
|
|
|
evowner.notify.indicate(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname)),evdata.copy()); | |
Macro used to signal a named notification event and corresponding data for the current methodology, but with a 'copy' of the original data
|
|
|
evowner.notify.indicate(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname)),evdata); | |
Macro used to signal a named notification event and corresponding data for the current methodology
|
|
|
evowner.notify.indicate(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to signal a named notification event for the current methodology
|
|
|
10
|
|
|
"unset_inst"
| |
Default string used as the initial value in all instances to recognize instances whose names have and have not been set.
|
|
|
'h3000000
|
|
|
`ifdef SVT_UVM_ENABLE_FGP `ifdef SVT_UVM_TECHNOLOGY `ifndef SVT_MULTI_SIM_UNIDENTIFIED_PRAGMA (* snps_uvm_fgp_lock *) `endif `endif `endif | |
Declares FGP lock for a task/method
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
vmm_verbose(log, $sformatf("%s() - %s", id, msg)) |
|
|
`ifdef SVT_ENABLE_FILE_AND_LINE_DISPLAY do if ((clientfile != "") || (clientline != 0)) `svt_verbose_file_line(log, $sformatf("%s() - %s", id, msg), clientfile, clientline); else svt_verbose(id, msg); while (0) `else svt_verbose(id, msg) `endif |
|
|
1
|
|
|
|
|
vmm_log::VERBOSE_SEV
|
|
|
|
|
endfunction `ifndef vmm_data_new_used static VMM_LOG log = new(`"_class`", `"class`"); function new(vmm_log log = null); super.new((log == null) ? this.log : log); endfunction `endif `undef vmm_data_new_used svt_vmm_data_methods(_class) |
|
|
local virtual function string this_class_name(); return `"_class`"; endfunction local virtual function vmm_log get_vmm_log(); return this.log; endfunction virtual function vmm_data allocate(); _class i; this.__vmm_done_user = 1; if ($cast(i,this.do_allocate())) begin if (this.__vmm_done_user) return i; end else begin vmm_fatal(this.log, `"Cannot cast result of do_allocate to _class`"); return null; end i = new; return i; endfunction virtual function bit is_valid(bit silent = 1, int kind = -1); this.__vmm_done_user = 1; is_valid = this.do_is_valid(silent, kind); if (this.__vmm_done_user) return is_valid; return 1; endfunction virtual function string psdisplay(string prefix = `"`"); string disp; disp = svt_shorthand_psdisplay(prefix); disp = $sformatf("%s%s", disp, svt_shorthand_psdisplay_hook(prefix)); return disp; endfunction virtual function vmm_data copy(vmm_data to = null); _class cpy; this.__vmm_done_user = 1; copy = this.do_copy(to); if (this.__vmm_done_user) return copy; if (to == null) begin if (!$cast(cpy, allocate())) begin vmm_fatal(this.log, `"Cannot allocate to non-_class instance`"); end end else if (!$cast(cpy, to)) begin vmm_fatal(this.log, `"Cannot copy to non-_class instance`"); return null; end super.copy_data(cpy); this.__vmm_rhs = cpy; this.do_all(DO_COPY, __vmm_bytes, __vmm_bytes); /* Call the svt_post_do_all_do_copy method. */ this.svt_post_do_all_do_copy(cpy); return cpy; endfunction virtual function bit compare( vmm_data to, output string diff, input int kind = -1); _class cp; svt_data svt_this; /* Initialize the return */ compare = 1; if (to == null) begin diff = `"'to' is NULL`"; return 0; end if (!$cast(svt_this, this)) begin svt_fatal("compare", "Failed attempting to cast vmm_data instance to svt_data instance. Unable to continue."); end else if (!svt_this.get_do_compare_done()) begin this.__vmm_done_user = 1; compare = this.do_compare(to, diff, kind); if (this.__vmm_done_user) begin /* Clear the do_compare_done flag so we can compare again */ do_compare_done = 0; return compare; end end if (!$cast(cp, to)) begin diff = `"'to' is not a _class instance`"; /* Clear the do_compare_done flag so we can compare again */ do_compare_done = 0; return 0; end this.__vmm_rhs = cp; this.__vmm_kind = kind; this.do_all(DO_COMPARE, __vmm_bytes, __vmm_bytes); diff = { diff, this.__vmm_image }; compare &= this.__vmm_status; /* Clear the do_compare_done flag so we can compare again */ do_compare_done = 0; endfunction virtual function int unsigned byte_pack(ref logic [7:0] bytes[], input int unsigned offset = 0, input int kind = -1); svt_data svt_this; int min_size; if (!$cast(svt_this, this)) begin svt_fatal("byte_pack", "Failed attempting to cast vmm_data instance to svt_data instance. Unable to continue."); end else if (!svt_this.get_do_pack_done()) begin this.__vmm_done_user = 1; byte_pack = this.do_byte_pack(bytes, offset, kind); if (this.__vmm_done_user) return byte_pack; end min_size = offset + this.__vmm_byte_size(kind); if (bytes.size() < min_size) bytes = new [min_size] (bytes); this.__vmm_offset = byte_pack + offset; this.__vmm_kind = kind; this.do_all(DO_PACK, bytes, __vmm_bytes); return this.__vmm_offset - offset; endfunction virtual function int unsigned byte_unpack(const ref logic [7:0] bytes[], input int unsigned offset = 0, input int len = -1, input int kind = -1); svt_data svt_this; if (!$cast(svt_this, this)) begin svt_fatal("byte_unpack", "Failed attempting to cast vmm_data instance to svt_data instance. Unable to continue."); end else if (!svt_this.get_do_pack_done()) begin this.__vmm_done_user = 1; byte_unpack = this.do_byte_unpack(bytes, offset, len, kind); if (this.__vmm_done_user) return byte_unpack; end this.__vmm_offset = byte_unpack + offset; this.__vmm_len = len; this.__vmm_kind = kind; this.do_all(DO_UNPACK, __vmm_bytes, bytes); /* Call the svt_post_do_all_do_byte_unpack method. */ this.svt_post_do_all_do_byte_unpack(); return this.__vmm_offset - offset; endfunction |
|
|
`define vmm_data_new_used 1 |
|
|
vmm_callback(CB,METHOD); |
|
|
foreach (OBJ.callbacks[i]) begin CB cb; if (!$cast(cb, OBJ.callbacks[i])) continue; cb.METHOD; end |
|
|
|
|
|
|
|
|
|
|
|
|
vmm_std_lib
|
|
|
|
vmm_voter
|
|
|
evowner.notify.wait_for_off(evowner.evname); | |
Macro used to wait for an 'off' notification event in the current methodology
|
|
|
evowner.notify.wait_for(evowner.evname); | |
Macro used to wait for an 'on' notification event in the current methodology
|
|
|
evowner.notify.wait_for(evowner.evname); | |
Macro used to wait for a 'persistent' notification event in the current methodology
|
|
|
evowner.notify.wait_for(evowner.evname); | |
Macro used to wait for a notification event in the current methodology
|
|
|
evowner.notify.wait_for_off(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to wait for an 'off' named notification event in the current methodology
|
|
|
evowner.notify.wait_for(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to wait for an 'on' named notification event in the current methodology
|
|
|
evowner.notify.wait_for(evowner.notify.get_notification_id(SVT_DATA_UTIL_ARG_TO_STRING(evname))); | |
Macro used to wait for a named notification event in the current methodology
|
|
|
vmm_warning(log, $sformatf("%s() - %s", id, msg)) | |
VMM_LOG_FORMAT_FILE_LINE must be set to cause VMM generated messages to go out with FILE/LINE information. The same holds for SVT and VIP messages going out in a VMM system which supports FILE/LINE messaging.
Additionally, SVT_ENABLE_FILE_AND_LINE_DISPLAY must be set to cause SVT and VIP messages to go out with FILE/LINE information within a VMM system. So both of these defines must be set in order to enable FILE/LINE display in the SVT VIPs in VMM. Since the FILE/LINE support is only available in later versions of VMM we also have to look for the existence of the VMM macros before deciding if the VMM FILE/LINE support is available. Based on all of the above we must clear SVT_ENABLE_FILE_AND_LINE_DISPLAY if the VMM FILE/LINE macros are not available, either because VMM_LOG_FORMAT_FILE_LINE has not been specified or because we are using an older version of VMM. |
|
|
`ifdef SVT_ENABLE_FILE_AND_LINE_DISPLAY do if ((clientfile != "") || (clientline != 0)) `svt_warning_file_line(log, $sformatf("%s() - %s", id, msg), clientfile, clientline); else svt_warning(id, msg); while (0) `else svt_warning(id, msg) `endif |
|
|
4
|
|
|
|
|
vmm_log::WARNING_SEV
|
|
|
0
| |
Writer type constants used for controlling the writer format
|
|
|
3
|
|
|
1
|
|
|
2
|
|
|
if `SVT_DATA_UTIL_X_OR_Z(portObj) begin $swrite(portStrValue, "%0b", portObj ); end else begin $swrite(portStrValue, "%0h", portObj ); end | |
Used in the command model class body for each callback to make it available at the command layer. Implements the inherited OO callback method. The base transactor should have defined a virtual method with the basic prototype "callback_method_name( callback_datatype data )". callback_name is of the form EVENT_CB_...
|
|
|
|
int
|
|
|
vmm_atomic_gen_using(class_name, class_name``_channel, text) |
|
|
class``_atomic_gen
|
|
|
class``_atomic_gen_callbacks
|
|
|
typedef class vmm_atomic_gen_(class_name); class vmm_atomic_gen_callbacks_(class_name) extends vmm_xactor_callbacks; virtual task post_inst_gen(vmm_atomic_gen_(class_name) gen, class_name obj, ref bit drop); endtask endclass class vmm_atomic_gen_(class_name) extends VMM_XACTOR; int unsigned stop_after_n_insts; typedef enum int {GENERATED, DONE} symbols_e; class_name randomized_obj; channel_name out_chan; local int scenario_count; local int obj_count; virtual function string psdisplay(string prefix = ""); psdisplay = super.psdisplay(prefix); $sformat(psdisplay, "%s [stops after #insts %0d>%0d]", psdisplay, this.obj_count, this.stop_after_n_insts); $sformat(psdisplay, "%s\n%sOutChan: %s(%s) [level=%0d of %0d]", psdisplay, prefix, this.out_chan.log.get_name(), this.out_chan.log.get_instance(), this.out_chan.level(), this.out_chan.full_level()); if (this.randomized_obj != null) begin prefix = {prefix, "Factory: "}; psdisplay = {psdisplay, "\n", this.randomized_obj.psdisplay(prefix)}; end return psdisplay; endfunction: psdisplay function new(string inst, int stream_id = -1, channel_name out_chan = null VMM_XACTOR_NEW_ARGS); super.new({text, " Atomic Generator"}, inst, stream_id VMM_XACTOR_NEW_CALL); if (out_chan == null) begin out_chan = new({text, " Atomic Generator output channel"}, inst); VMM_OBJECT_SET_PARENT(out_chan, this) end this.out_chan = out_chan; this.out_chan.set_producer(this); this.log.is_above(this.out_chan.log); this.scenario_count = 0; this.obj_count = 0; this.stop_after_n_insts = 0; void'(this.notify.configure(GENERATED, vmm_notify::ONE_SHOT)); void'(this.notify.configure(DONE, vmm_notify::ON_OFF)); this.randomized_obj = new; VMM_OBJECT_SET_PARENT(this.randomized_obj, this) endfunction: new virtual task inject(class_name obj, ref bit dropped); dropped = 0; vmm_callback(vmm_atomic_gen_callbacks_(class_name), post_inst_gen(this, obj, dropped)); if (!dropped) begin this.obj_count++; this.notify.indicate(GENERATED, obj); this.out_chan.put(obj); end endtask: inject virtual function void reset_xactor(vmm_xactor::reset_e rst_typ = SOFT_RST); super.reset_xactor(rst_typ); this.out_chan.flush(); this.scenario_count = 0; this.obj_count = 0; if (rst_typ >= FIRM_RST) begin this.notify.reset( , vmm_notify::HARD); end if (rst_typ >= HARD_RST) begin this.stop_after_n_insts = 0; this.randomized_obj = new; end endfunction: reset_xactor virtual protected task main(); bit dropped; fork super.main(); join_none while (this.stop_after_n_insts <= 0 || this.obj_count < this.stop_after_n_insts) begin this.wait_if_stopped(); this.randomized_obj.stream_id = this.stream_id; this.randomized_obj.scenario_id = this.scenario_count; this.randomized_obj.data_id = this.obj_count; if (!this.randomized_obj.randomize()) begin vmm_fatal(this.log, "Cannot randomize atomic instance"); continue; end begin class_name obj; $cast(obj, this.randomized_obj.copy()); VMM_OBJECT_SET_PARENT(obj, this) this.inject(obj, dropped); end end this.notify.indicate(DONE); this.notify.indicate(XACTOR_STOPPED); this.notify.indicate(XACTOR_IDLE); this.notify.reset(XACTOR_BUSY); this.scenario_count++; endtask: main endclass |
|
|
class``_atomic_scenario
|
|
|
do foreach (this.callbacks[vmm_i]) begin facade cb; if (!$cast(cb, this.callbacks[vmm_i])) continue; cb.call; end while (0) |
|
|
vmm_channel
|
|
|
class vmm_channel_(T) extends vmm_channel; function new(string name, string inst, int full = 1, int empty = 0, bit fill_as_bytes = 0); super.new(name, inst, full, empty, fill_as_bytes); endfunction: new function T unput(int offset = -1); $cast(unput, super.unput(offset)); endfunction: unput task get(output T obj, input int offset = 0); vmm_data o; super.get(o, offset); $cast(obj, o); endtask: get task peek(output T obj, input int offset = 0); vmm_data o; super.peek(o, offset); $cast(obj, o); endtask: peek function T try_peek(int offset = 0); vmm_data o; o = super.try_peek(offset); $cast(try_peek, o); endfunction: try_peek task activate(output T obj, input int offset = 0); vmm_data o; super.activate(o, offset); $cast(obj, o); endtask: activate function T active_slot(); $cast(active_slot, super.active_slot()); endfunction: active_slot function T start(); $cast(start, super.start()); endfunction: start function T complete(vmm_data status = null); $cast(complete, super.complete(status)); endfunction: complete function T remove(); $cast(remove, super.remove()); endfunction: remove task tee(output T obj); vmm_data o; super.tee(o); $cast(obj, o); endtask: tee function T for_each(bit reset = 0); $cast(for_each, super.for_each(reset)); endfunction: for_each endclass |
|
|
T``_channel
|
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::TRACE_SEV) begin if (log.start_msg(vmm_log::COMMAND_TYP)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::COMMAND_TYP)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
vmm_consensus
|
|
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::VERBOSE_SEV) begin if (log.start_msg(vmm_log::CYCLE_TYP)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::CYCLE_TYP)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
vmm_data
|
|
|
|
|
|
`define vmm_data_byte_size_used 1 virtual protected function int unsigned __vmm_byte_size(int kind = -1); return this.byte_size(kind); endfunction: __vmm_byte_size virtual function int unsigned byte_size(int kind = -1); this.__vmm_done_user = 1; byte_size = this.do_byte_size(kind); if (this.__vmm_done_user) return byte_size; return _n; endfunction: byte_size virtual function int unsigned max_byte_size(int kind = -1); this.__vmm_done_user = 1; max_byte_size = this.do_max_byte_size(kind); if (this.__vmm_done_user) return max_byte_size; return _max; endfunction |
|
|
protected static _class __vmm_rhs; function void do_all(vmm_data::do_what_e do_what, ref logic [7:0] pack[], const ref logic [7:0] unpack[]); super.__vmm_rhs = this.__vmm_rhs; this.__vmm_status = 1; case (do_what) DO_PRINT: begin this.__vmm_image = super.psdisplay(this.__vmm_prefix); if (vmm_str_match(this.__vmm_prefix, ": $")) begin this.__vmm_prefix = {vmm_str_prematch(this.__vmm_prefix), "."}; end end DO_COPY: begin void'(super.copy(this.__vmm_rhs)); end DO_COMPARE: begin if (!super.compare(this.__vmm_rhs, this.__vmm_image)) begin this.__vmm_status = 0; return; end end DO_PACK: begin int _offset = this.__vmm_offset; this.__vmm_offset = _offset + super.byte_pack(pack, _offset, this.__vmm_kind); end DO_UNPACK: begin int _offset = this.__vmm_offset; this.__vmm_offset = _offset + super.byte_unpack(unpack, _offset, this.__vmm_len, this.__vmm_kind); end endcase |
|
|
endfunction `ifndef vmm_data_new_used static VMM_LOG log = new(`"_class`", `"class`"); function new(vmm_log log = null); super.new((log == null) ? this.log : log); this.log =(log==null)?this.log : log; endfunction `endif `undef vmm_data_new_used `ifdef ENABLE_DEF_BYTE_SIZE_IMP `ifndef vmm_data_byte_size_used vmm_data_byte_size(0,0) `endif `endif `undef vmm_data_byte_size_used vmm_data_methods(_class) |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s _name=%s`", this.__vmm_image, this.__vmm_prefix, this._name.name()); end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin if (__vmm_rhs._name !== this._name) begin $sformat(this.__vmm_image, `"this._name (%s) !== to._name (%s)`", this._name.name(), __vmm_rhs._name.name()); this.__vmm_status = 0; return; end end DO_PACK: begin int start; int count; start = this.__vmm_offset; count = 4; this.__vmm_maxbits = this._name; vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; int enumvalue; start = this.__vmm_offset; count = 4; vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) enumvalue = this.__vmm_maxbits; $cast(this._name,enumvalue); vmm_data_member_update_offset(this.__vmm_offset,count) end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach(this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) begin $sformat(this.__vmm_image, `"%s %0d: %s `", this.__vmm_image, i, this._name[i].name()); if (_count == 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; end end _count++; end $sformat(this.__vmm_image, `"%s`", this.__vmm_image); end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin __vmm_rhs._name[i]=this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[%0d] exists but to._name[%0d] does not`", i, i); this.__vmm_status = 0; return; end else if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%s) !== to._name[%0d] (%s)`", i, this._name[i].name, i, __vmm_rhs._name[i].name); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; int index; string stemp; bit [31:0] size=0; start = this.__vmm_offset; this.__vmm_maxbits = 0; size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) foreach (this._name[j]) begin this.__vmm_maxbits = 0; stemp = this._name[j].name(); count = (stemp.len()); this.__vmm_maxbits = this._name[j].name(); index = j; vmm_data_member_scalar_packint(pack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; int index=0; string stemp; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits =0; for (int j=0; j < size; j++) begin this.__vmm_maxbits =0; vmm_data_member_scalar_unpackint(unpack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) stemp = string'(this.__vmm_maxbits); count = 0; vmm_data_member_enum_set_name(this._name[index],stemp,count) this.__vmm_maxbits =`"`"; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach(this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) begin $sformat(this.__vmm_image, `"%s ``%s':%s`", this.__vmm_image, i, this._name[i].name); if (_count == 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; end end _count++; end end DO_COPY: begin __vmm_rhs._name.delete(); foreach (this._name[i]) begin __vmm_rhs._name[i] = this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[``%s'] exists but to._name[``%s'] does not`", i, i); this.__vmm_status = 0; return; end else if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[``%s'] (%s) !== to._name[``%s'] (%s)`", i, this._name[i].name, i, __vmm_rhs._name[i].name); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; int index; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; start = this.__vmm_offset; stemp = this._name.first(sindextemp); index = 0; size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; foreach (this._name[j]) begin this.__vmm_maxbits =0; sindextemp = j; sindexcount = sindextemp.len(); this.__vmm_maxbits = sindextemp; vmm_data_member_scalar_packint(pack,sindexcount,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,sindexcount) this.__vmm_maxbits =0; stemp = this._name[j].name(); count = (stemp.len()); vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = this._name[j].name(); vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int start; int count; int index; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; index = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; for (int j=0; j < size; j++) begin this.__vmm_maxbits = 0; vmm_data_member_scalar_unpackint(unpack,sindexcount,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,sindexcount) sindextemp = string'(this.__vmm_maxbits); this.__vmm_maxbits = 0; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) stemp = string'(this.__vmm_maxbits); index = 0; vmm_data_member_enum_set_name(this._name[sindextemp],stemp,index) this.__vmm_maxbits =`"`"; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int size =0; size = $size(this._name); $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, size); for (int i = 0; i < size; i++) begin $sformat(this.__vmm_image, `"%s %s`", this.__vmm_image, this._name[i].name()); if (i == 2 && size > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = size - 3; end end end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin foreach (this._name[i]) begin if (__vmm_rhs._name[i] !== this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%s) !== to._name[%0d] (%s)`", i, this._name[i].name(), i, __vmm_rhs._name[i].name()); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; string stemp; bit [31:0] size=0; start = this.__vmm_offset; vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; foreach (this._name[j]) begin stemp = this._name[j].name(); count = (stemp.len()); this.__vmm_maxbits = this._name[j].name(); vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) size++; end vmm_data_member_scalar_packint(pack,size,start,0) this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; int index; string stemp; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits =0; for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) stemp = string'(this.__vmm_maxbits); index = 0; vmm_data_member_enum_set_name(this._name[j],stemp,index) this.__vmm_maxbits =`"`"; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.size()); for (int i = 0; i < this._name.size(); i++) begin $sformat(this.__vmm_image, `"%s %s`", this.__vmm_image, this._name[i].name()); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = this._name.size() - 3; end end end DO_COPY: begin __vmm_rhs._name = new [this._name.size()]; foreach(this._name[i]) __vmm_rhs._name[i] = this._name[i]; end DO_COMPARE: begin if (__vmm_rhs._name.size() !== this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (__vmm_rhs._name[i] !== this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%s) !== to._name[%0d] (%s)`", i, this._name[i].name(), i, __vmm_rhs._name[i].name()); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; int index; int element; string stemp; bit [31:0] size=0; start = this.__vmm_offset; size = this._name.size(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; foreach (this._name[j]) begin stemp = this._name[j].name(); count = (stemp.len()); this.__vmm_maxbits = this._name[j].name(); vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int index; int start; string stemp; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this._name = new [size]; this.__vmm_maxbits =0; for (int j=0; j < size; j++) begin this.__vmm_maxbits =`"`"; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) stemp = string'(this.__vmm_maxbits); index = 0; vmm_data_member_enum_set_name(this._name[j],stemp,index) this.__vmm_maxbits =`"`"; end end endcase |
|
|
if ( __stemp == __name.name()) begin __name = __name; __index =0; end else begin /* stevenm 8/2/2012 -- Added the following to the official VMM version insure we start on a valid enum. */ __name = __name.first(); while ( __stemp != __name.name()) begin __name = __name.next(); if ( __index > __name.num() ) break; __index++; end end |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s``_name is %s`", this.__vmm_image, this.__vmm_prefix, (this._name == null) ? `"null`" : `"`"); this.__vmm_prefix = _prefix; end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin string diff; if (this._name != __vmm_rhs._name) begin this.__vmm_image = `"this._name !== to._name`"; this.__vmm_status = 0; return; end end DO_PACK: begin end DO_UNPACK: begin this._name = null; end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach(this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) $sformat(this.__vmm_image, `"%s %0d: %s`", this.__vmm_image, i,(this._name[i] == null) ? `"null`" : `"`"); if (_count== 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `"\n...`"}; end _count++; end end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin __vmm_rhs._name[i] = new; __vmm_rhs._name[i] = this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[%0d] exists but to._name[%0d] does not`", i, i); this.__vmm_status = 0; return; end if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_PACK: begin end DO_UNPACK: begin foreach (this._name[i]) begin this._name[i] = null; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach(this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) $sformat(this.__vmm_image, `"%s ``%s': %s`", this.__vmm_image, i,(this._name[i] == null) ? `"null`" : `"`"); if (_count== 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `"\n...`"}; end _count++; end end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin __vmm_rhs._name[i] = new; __vmm_rhs._name[i] = this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[``%s'] exists but to._name[``%s'] does not`", i, i); this.__vmm_status = 0; return; end if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[``%s'] !== to._name[``%s']`", i, i); this.__vmm_status = 0; return; end end end DO_PACK: begin end DO_UNPACK: begin foreach (this._name[i]) begin this._name[i] = null; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int size =0; size = $size(this._name); $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, size); for (int i = 0; i < size; i++) begin $sformat(this.__vmm_image, `"%s %s`", this.__vmm_image, (this._name[i] == null) ? `"null`" : `"`"); if (i == 2 && size > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = size - 3; end end end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin foreach (this._name[i]) begin if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_PACK: begin end DO_UNPACK: begin foreach (this._name[i]) begin this._name[i] = null; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.size()); for (int i = 0; i < this._name.size(); i++) begin $sformat(this.__vmm_image, `"%s %s`", this.__vmm_image, (this._name[i] == null) ? `"null`" : `"`"); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = this._name.size() - 3; end end end DO_COPY: begin __vmm_rhs._name = new[this._name.size()]; foreach(this._name[i]) begin __vmm_rhs._name[i] = this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.size() !== this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_PACK: begin end DO_UNPACK: begin foreach (this._name[i]) begin this._name[i] = null; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.size()); for (int i = 0; i < this._name.size(); i++) begin $sformat(this.__vmm_image, `"%s %s`", this.__vmm_image, (this._name[i] == null) ? `"null`" : `"`"); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = this._name.size() - 3; end end end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin if (__vmm_rhs._name.size() !== this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_PACK: begin end DO_UNPACK: begin foreach (this._name[i]) begin this._name[i] = null; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name=%0f`", this.__vmm_image, this.__vmm_prefix, this._name); end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin if (__vmm_rhs._name != this._name) begin $sformat(this.__vmm_image, `"this._name (%0f) != to._name (%0f)`", this._name, __vmm_rhs._name); this.__vmm_status = 0; return; end end DO_PACK: begin int count = 8; this.__vmm_maxbits = $realtobits(this._name); vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end DO_UNPACK: begin int count = 8; int start; start = this.__vmm_offset; vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name = $bitstoreal(this.__vmm_maxbits); vmm_data_member_update_offset(this.__vmm_offset,count) end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int size =0; size = $size(this._name); $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, size); for (int i = 0; i < size; i++) begin $sformat(this.__vmm_image, `"%s 'h%0h`", this.__vmm_image, this._name[i]); if (i == 2 && size > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = size - 3; end end end DO_COPY: begin /*__vmm_rhs._name = new [this._name.size()];*/ foreach(this._name[i]) __vmm_rhs._name[i]=this._name[i]; end DO_COMPARE: begin if ($size(__vmm_rhs._name) != $size(this._name)) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) != to._name.size() (%0d)`", $size(this._name), $size(__vmm_rhs._name)); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%0f) != to._name[%0d] (%0f)`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count = 8; int index; bit [31:0] size=0; start = this.__vmm_offset; size = $size(this._name); vmm_data_member_update_offset(this.__vmm_offset,8) foreach (this._name[j]) begin this.__vmm_maxbits = $realtobits(this._name[j]); vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_scalar_packint(pack,count,(start+4),0) end DO_UNPACK: begin int start; int count = 8; int index; bit [31:0] size = 0; vmm_data_member_scalar_unpackint(unpack,size,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) /* this._name = new [size]; */ for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name[j] = $bitstoreal(this.__vmm_maxbits); vmm_data_member_update_offset(this.__vmm_offset,count) end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.size()); for (int i = 0; i < this._name.size(); i++) begin $sformat(this.__vmm_image, `"%s 'h%0h`", this.__vmm_image, this._name[i]); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = this._name.size() - 3; end end end DO_COPY: begin __vmm_rhs._name = new [this._name.size()]; foreach(this._name[i]) __vmm_rhs._name[i]=this._name[i]; end DO_COMPARE: begin if (__vmm_rhs._name.size() != this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) != to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%0f) != to._name[%0d] (%0f)`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count = 8; int index; bit [31:0] size=0; start = this.__vmm_offset; size = this._name.size(); vmm_data_member_update_offset(this.__vmm_offset,8) foreach (this._name[j]) begin this.__vmm_maxbits = $realtobits(this._name[j]); vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_scalar_packint(pack,count,(start+4),0) end DO_UNPACK: begin int start; int count = 8; int index; bit [31:0] size = 0; vmm_data_member_scalar_unpackint(unpack,size,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) this._name = new [size]; for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name[j] = $bitstoreal(this.__vmm_maxbits); vmm_data_member_update_offset(this.__vmm_offset,count) end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name='h%0h`", this.__vmm_image, this.__vmm_prefix, this._name); end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin if (__vmm_rhs._name !== this._name) begin $sformat(this.__vmm_image, `"this._name ('h%0h) !== to._name ('h%0h)`", this._name, __vmm_rhs._name); this.__vmm_status = 0; return; end end DO_PACK: begin int count; vmm_data_member_scalar_count(this._name,count) this.__vmm_maxbits = this._name; vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end DO_UNPACK: begin int count; int start; start = this.__vmm_offset; vmm_data_member_scalar_count(this._name,count) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name = this.__vmm_maxbits; vmm_data_member_update_offset(this.__vmm_offset,count) end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach (this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) $sformat(this.__vmm_image, `"%s %0d:`h%0h`", this.__vmm_image, i, this._name[i]); if (_count == 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; end _count++; end end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin __vmm_rhs._name[i]=this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[%0d] exists but to._name[%0d] does not`", i, i); this.__vmm_status = 0; return; end else if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d]:'h%0h !== to._name[%0d]:'h%0h`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; int index; int element; bit [31:0] size=0; start = this.__vmm_offset; element = this._name.first(index); vmm_data_member_scalar_count(element,count) element = 0; size = this._name.num(); vmm_data_member_update_offset(this.__vmm_offset,8) foreach (this._name[j]) begin this.__vmm_maxbits = this._name[j]; index = j; vmm_data_member_scalar_packint(pack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_scalar_packint(pack,count,(start+4),0) end DO_UNPACK: begin int start; int count; int index; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpackint(unpack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this._name[index] = this.__vmm_maxbits; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach (this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) $sformat(this.__vmm_image, `"%s ``%s':'h%0h`", this.__vmm_image, i, this._name[i]); if (_count == 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; end _count++; end end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin __vmm_rhs._name[i] = this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if(!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[``%s'] exists but to._name[``%s'] does not`", i, i); this.__vmm_status = 0; return; end else if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[``%s']:'h%0h !== to._name[``%s']:'h%0h`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; start = this.__vmm_offset; stemp = this._name.first(sindextemp); size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; foreach (this._name[j]) begin this.__vmm_maxbits =0; sindextemp = j; sindexcount = sindextemp.len(); this.__vmm_maxbits = sindextemp; vmm_data_member_scalar_packint(pack,sindexcount,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,sindexcount) this.__vmm_maxbits =0; vmm_data_member_scalar_count(this._name[j],count) vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = this._name[j]; vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int start; int count; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; this.__vmm_maxbits = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpackint(unpack,sindexcount,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) sindextemp = string'(this.__vmm_maxbits); vmm_data_member_update_offset(this.__vmm_offset,sindexcount) this.__vmm_maxbits = 0; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name[sindextemp] = string'(this.__vmm_maxbits); vmm_data_member_update_offset(this.__vmm_offset,count) end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int size =0; size = $size(this._name); $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, size); for (int i = 0; i < size; i++) begin $sformat(this.__vmm_image, `"%s 'h%0h`", this.__vmm_image, this._name[i]); if (i == 2 && size > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = size - 3; end end end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin foreach (this._name[i]) begin if (__vmm_rhs._name[i] !== this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] ('h%0h) !== to._name[%0d] ('h%0h)`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; bit [31:0] size=0; start = this.__vmm_offset; vmm_data_member_update_offset(this.__vmm_offset,8) foreach (this._name[j]) begin if ( j == 0 ) vmm_data_member_scalar_count(this._name[j],count) this.__vmm_maxbits = this._name[j]; vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) size++; end vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_scalar_packint(pack,count,(start+4),0) this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int start; int count; bit [31:0] size = 0; vmm_data_member_scalar_unpackint(unpack,size,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name[j] = this.__vmm_maxbits; vmm_data_member_update_offset(this.__vmm_offset,count) end end endcase |
|
|
__count = ($bits(__name)-1)/8 + 1; |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.size()); for (int i = 0; i < this._name.size(); i++) begin $sformat(this.__vmm_image, `"%s 'h%0h`", this.__vmm_image, this._name[i]); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = this._name.size() - 3; end end end DO_COPY: begin __vmm_rhs._name = new [this._name.size()]; foreach(this._name[i]) __vmm_rhs._name[i]=this._name[i]; end DO_COMPARE: begin if (__vmm_rhs._name.size() !== this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (__vmm_rhs._name[i] !== this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] ('h%0h) !== to._name[%0d] ('h%0h)`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count = 0; int index; bit [31:0] size=0; start = this.__vmm_offset; size = this._name.size(); vmm_data_member_update_offset(this.__vmm_offset,8) foreach (this._name[j]) begin if ( j == 0) begin vmm_data_member_scalar_count(this._name[j],count) end this.__vmm_maxbits = this._name[j]; vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_scalar_packint(pack,count,(start+4),0) end DO_UNPACK: begin int start; int count; int index; bit [31:0] size = 0; vmm_data_member_scalar_unpackint(unpack,size,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) this._name = new [size]; for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) this._name[j] = this.__vmm_maxbits; vmm_data_member_update_offset(this.__vmm_offset,count) end end endcase |
|
|
if (__pack.size() < __offset+__count) __pack = new [__offset+__count] (__pack); for (int i=0; i < __count; i++) begin __pack[__offset+i] = __maxbits[i*8 +: 8]; end |
|
|
if (__pack.size() < __st+4) __pack = new [__st+4] (__pack); if ( __endian) begin {__pack[__st],__pack[__st+1],__pack[__st+2],__pack[__st+3]} = __index; end else begin {__pack[__st+3],__pack[__st+2],__pack[__st+1],__pack[__st]} = __index; end |
|
|
for (int i=0; i < __count; i++) begin __maxbits[i*8 +: 8] = __unpack[__offset+i]; end |
|
|
if ( __endian) begin __index = {__unpack[__st],__unpack[__st+1],__unpack[__st+2],__unpack[__st+3]}; end else begin __index = {__unpack[__st+3],__unpack[__st+2],__unpack[__st+1],__unpack[__st]}; end |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name=```%s'`", this.__vmm_image, this.__vmm_prefix, this._name); end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin if (__vmm_rhs._name != this._name) begin $sformat(this.__vmm_image, `"this._name (``%s') !== to._name (``%s')`", this._name, __vmm_rhs._name); this.__vmm_status = 0; return; end end DO_PACK: begin int start; int count; start = this.__vmm_offset; count = (this._name.len()); this.__vmm_maxbits = 0; vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) /* ORIGINAL: */ /* this.__vmm_maxbits = this._name; */ `ifdef SVT_MULTI_SIM_CAST_STRING_TO_PACKED_ARRAY $swrite(this.__vmm_maxbits, "%s", this._name); `else this.__vmm_maxbits = this._name; `endif vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; int size; this.__vmm_maxbits = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) /* ORIGINAL: */ /* this._name = this.__vmm_maxbits; */ `ifdef SVT_MULTI_SIM_ASSIGN_PACKED_ARRAY_TO_STRING this._name = $sformatf("%0s", this.__vmm_maxbits); `else this._name = string'(this.__vmm_maxbits); `endif vmm_data_member_update_offset(this.__vmm_offset,count) end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach(this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) $sformat(this.__vmm_image, `"%s %0d:``%s'`", this.__vmm_image, i, this._name[i]); if (_count == 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; end _count++; end $sformat(this.__vmm_image, `"%s'`", this.__vmm_image); end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin __vmm_rhs._name[i]=this._name[i]; end end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[%0d] exists but to._name[%0d] does not`", i, i); this.__vmm_status = 0; return; end else if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (``%s') !== to._name[%0d] (``%s')`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; int index; bit [31:0] size=0; start = this.__vmm_offset; this.__vmm_maxbits = 0; size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) foreach (this._name[j]) begin this.__vmm_maxbits = 0; count = (this._name[j].len()); this.__vmm_maxbits = this._name[j]; index = j; vmm_data_member_scalar_packint(pack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int start; int count; int index; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; for (int j=0; j < size; j++) begin vmm_data_member_scalar_unpackint(unpack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this._name[index] = string'(this.__vmm_maxbits); this.__vmm_maxbits = 0; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.num()); foreach (this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) $sformat(this.__vmm_image, `"%s ``%s':``%s'`", this.__vmm_image, i, this._name[i]); if (_count == 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; end _count++; end end DO_COPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) __vmm_rhs._name[i] = this._name[i]; end DO_COMPARE: begin if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[``%s'] exists but to._name[``%s'] does not`", i, i); this.__vmm_status = 0; return; end else if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[``%s'] (``%s') !== to._name[``%s'] (``%s')`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; string sindextemp; int sindexcount; bit [31:0] size=0; start = this.__vmm_offset; size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; foreach (this._name[j]) begin this.__vmm_maxbits =0; sindextemp = j; sindexcount = sindextemp.len(); this.__vmm_maxbits = sindextemp; vmm_data_member_scalar_packint(pack,sindexcount,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,sindexcount) this.__vmm_maxbits =0; count = this._name[j].len(); vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = this._name[j]; vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int start; int count; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; this.__vmm_maxbits = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) for (int j=0; j < size; j++) begin this.__vmm_maxbits = 0; vmm_data_member_scalar_unpackint(unpack,sindexcount,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,sindexcount) sindextemp = string'(this.__vmm_maxbits); this.__vmm_maxbits = 0; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this._name[sindextemp] = string'(this.__vmm_maxbits); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int size =0; size = $size(this._name); $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, size); for (int i = 0; i < size; i++) begin $sformat(this.__vmm_image, `"%s ``%s'`", this.__vmm_image, this._name[i]); if (i == 2 && size > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = size - 3; end end end DO_COPY: begin __vmm_rhs._name = this._name; end DO_COMPARE: begin foreach (this._name[i]) begin if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%s) !== to._name[%0d] (%s)`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; string stemp; bit [31:0] size=0; start = this.__vmm_offset; vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits =0; foreach (this._name[j]) begin count = (this._name[j].len()); this.__vmm_maxbits = this._name[j]; vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) size++; end vmm_data_member_scalar_packint(pack,size,start,0) this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; bit [31:0] size = 0; start = this.__vmm_offset; this.__vmm_maxbits =0; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) for (int j=0; j < size; j++) begin this.__vmm_maxbits =`"`"; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this._name[j] = string'(this.__vmm_maxbits); this.__vmm_maxbits =`"`"; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s``_name[%0d]=`", this.__vmm_image, this.__vmm_prefix, this._name.size()); for (int i = 0; i < this._name.size(); i++) begin $sformat(this.__vmm_image, `"%s ``%s'`", this.__vmm_image, this._name[i]); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `" ...`"}; i = this._name.size() - 3; end end end DO_COPY: begin __vmm_rhs._name = new [this._name.size()]; foreach(this._name[i]) __vmm_rhs._name[i] = this._name[i]; end DO_COMPARE: begin if (__vmm_rhs._name.size() !== this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end foreach (this._name[i]) begin if (__vmm_rhs._name[i] != this._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] (%s) !== to._name[%0d] (%s)`", i, this._name[i], i, __vmm_rhs._name[i]); this.__vmm_status = 0; return; end end end DO_PACK: begin int start; int count; int firstcount; string stemp; bit [31:0] size=0; start = this.__vmm_offset; size = this._name.size(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits =0; foreach (this._name[j]) begin count = (this._name[j].len()); this.__vmm_maxbits = this._name[j]; vmm_data_member_scalar_packint(pack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int index; int start; bit [31:0] size = 0; start = this.__vmm_offset; this.__vmm_maxbits =0; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this._name = new [size]; for (int j=0; j < size; j++) begin this.__vmm_maxbits =`"`"; vmm_data_member_scalar_unpackint(unpack,count,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) this._name[j] = string'(this.__vmm_maxbits); this.__vmm_maxbits =`"`"; end end endcase |
|
|
__offset = __offset + __count; |
|
|
this.__vmm_status = this.do_``_name(do_what, this.__vmm_prefix, this.__vmm_image, this.__vmm_rhs, this.__vmm_kind, this.__vmm_offset, pack, unpack); if (__vmm_status == 0) return; |
|
|
case (do_what & _do) DO_PRINT: begin if ( _name == null ) begin $sformat(this.__vmm_image, `"%s\n%s%s: (null)`", this.__vmm_image, this.__vmm_prefix, `"_name`"); end else begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end end DO_COPY: begin if (_name == null) begin __vmm_rhs._name = this._name; end else begin case (_how & HOW_TO_COPY) DO_REFCOPY: begin __vmm_rhs._name = this._name; end DO_DEEPCOPY: begin $cast(__vmm_rhs._name, this._name.copy()); end endcase end end DO_COMPARE: begin if (_name == null || __vmm_rhs._name == null) begin if (this._name != __vmm_rhs._name) begin this.__vmm_image = `"this._name !== to._name !== NULL`"; this.__vmm_status = 0; return; end end else begin case (_how & HOW_TO_COMPARE) DO_REFCOMPARE: begin if (this._name != __vmm_rhs._name) begin $sformat(this.__vmm_image, `"this._name !== to._name`"); this.__vmm_status = 0; return; end end DO_DEEPCOMPARE: begin string diff; if (!this._name.compare(__vmm_rhs._name, diff)) begin $sformat(this.__vmm_image, `"this._name !== to._name: %s `", diff); this.__vmm_status = 0; return; end end endcase end end /* DO_PACK and DO_UNPACK have been modified from the official VMM 1.2 version */ /* to support packing and unpacking of null objects. */ DO_PACK: begin int count = 1; int exists = (_name == null) ? 0 : 1; vmm_data_member_scalar_pack(pack,exists,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) if (exists) begin /* __vmm_offset is a static data member, potentially modified by the contained byte_pack */ /* Save away the current value and restore it after the byte_pack */ int saved_offset = this.__vmm_offset; count = this._name.byte_pack(pack, this.__vmm_offset, this.__vmm_kind); this.__vmm_offset = saved_offset; vmm_data_member_update_offset(this.__vmm_offset,count) end end DO_UNPACK: begin int count = 1; int exists = 0; vmm_data_member_scalar_unpack(unpack,exists,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) if (exists) begin /* __vmm_offset is a static data member, potentially modified by the contained byte_unpack */ /* Save away the current value and restore it after the byte_unpack */ int saved_offset = this.__vmm_offset; this._name = new(); count = this._name.byte_unpack(unpack, this.__vmm_offset, this.__vmm_len, this.__vmm_kind); this.__vmm_offset = saved_offset; vmm_data_member_update_offset(this.__vmm_offset,count) end else begin this._name = null; end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin if (_count <= 2 || _count >= this._name.num()-2) begin string pf; $sformat(pf, `"%s``_name[%0d]`", _prefix, i); $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(pf)); if (_count== 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `"\n`", _prefix, `"...`"}; end _count++; end end this.__vmm_prefix = _prefix; end DO_COPY: begin case (_how & HOW_TO_COPY) DO_REFCOPY: begin __vmm_rhs._name.delete(); foreach (this._name[i]) begin __vmm_rhs._name[i] = this._name[i]; end end DO_DEEPCOPY: begin __vmm_rhs._name.delete(); foreach(this._name[i]) begin $cast(__vmm_rhs._name[i], this._name[i].copy()); end end endcase end DO_COMPARE: begin string diff; if (__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), __vmm_rhs._name.num()); this.__vmm_status = 0; return; end case (_how & HOW_TO_COMPARE) DO_REFCOMPARE: begin foreach (this._name[i]) begin if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[%0d] exists but to._name[%0d] does not`", i, i); this.__vmm_status = 0; return; end if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_DEEPCOMPARE: begin foreach(this._name[i]) begin $display("%s",__vmm_rhs.psdisplay("to::")); if (!__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[%0d] exists but to._name[%0d] does not`", i, i); this.__vmm_status = 0; return; end if (!this._name[i].compare(__vmm_rhs._name[i], diff)) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]: %s`", i, i, diff); this.__vmm_status = 0; return; end end end endcase end DO_PACK: begin int start; int count; int index; string stemp; bit [31:0] size=0; start = this.__vmm_offset; this.__vmm_maxbits = 0; size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) foreach (this._name[j]) begin int saved_offset = 0; this.__vmm_maxbits = 0; index = j; vmm_data_member_scalar_packint(pack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) /* __vmm_offset is a static data member, potentially modified by the contained byte_pack */ /* Save away the current value and restore it after the byte_pack */ saved_offset = this.__vmm_offset; count = this._name[j].byte_pack(pack, this.__vmm_offset, this.__vmm_kind); this.__vmm_offset = saved_offset; vmm_data_member_update_offset(this.__vmm_offset,count) end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; int index=0; string stemp; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits =0; for (int j=0; j < size; j++) begin int saved_offset = 0; this.__vmm_maxbits =0; vmm_data_member_scalar_unpackint(unpack,index,this.__vmm_offset,0) vmm_data_member_update_offset(this.__vmm_offset,4) this._name[index] = new(); /* __vmm_offset is a static data member, potentially modified by the contained byte_unpack */ /* Save away the current value and restore it after the byte_unpack */ saved_offset = this.__vmm_offset; count = this._name[index].byte_unpack(unpack, this.__vmm_offset, this.__vmm_len, this.__vmm_kind); this.__vmm_offset = saved_offset; vmm_data_member_update_offset(this.__vmm_offset,count) end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int _count = 0; string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin if(this._name[i] != null ) begin if (_count <= 2 || _count >= this._name.num()-2) begin string pf; $sformat(pf, `"%s``_name[``%s']`", _prefix, i); $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(pf)); if (_count== 2 && this._name.num() > 5) begin this.__vmm_image = {this.__vmm_image, `"\n`", _prefix, `"...`"}; end _count++; end end end this.__vmm_prefix = _prefix; end DO_COPY: begin case (_how & HOW_TO_COPY) DO_REFCOPY: begin this.__vmm_rhs._name.delete(); foreach (this._name[i]) begin this.__vmm_rhs._name[i] = this._name[i]; end end DO_DEEPCOPY: begin this.__vmm_rhs._name.delete(); foreach(this._name[i]) begin if(this._name[i] != null ) begin $cast(this.__vmm_rhs._name[i], this._name[i].copy()); end end end endcase end DO_COMPARE: begin string diff; if (this.__vmm_rhs._name.num() !== this._name.num()) begin $sformat(this.__vmm_image, `"this._name.num() (%0d) !== to._name.num() (%0d)`", this._name.num(), this.__vmm_rhs._name.num()); this.__vmm_status = 0; return; end case (_how & HOW_TO_COMPARE) DO_REFCOMPARE: begin this.__vmm_rhs._name.delete(); foreach (this._name[i]) begin if (!this.__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[``%s'] exists but to._name[``%s'] does not`", i, i); this.__vmm_status = 0; return; end if (this._name[i] != this.__vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_DEEPCOMPARE: begin this.__vmm_rhs._name.delete(); foreach(this._name[i]) begin if (!this.__vmm_rhs._name.exists(i)) begin $sformat(this.__vmm_image, `"this._name[``%s'] exists but to._name[``%s'] does not`", i, i); this.__vmm_status = 0; return; end if(this._name[i] != null) begin if (!this._name[i].compare(this.__vmm_rhs._name[i], diff)) begin $sformat(this.__vmm_image, `"this._name[``%s'] !== to._name[``%s']: %s`", i, i, diff); this.__vmm_status = 0; return; end end end end endcase end DO_PACK: begin int start; int count; int index; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; start = this.__vmm_offset; index = 0; size = this._name.num(); vmm_data_member_scalar_packint(pack,size,start,0) this.__vmm_maxbits = 0; foreach (this._name[j]) begin if(this._name[j] != null ) begin this.__vmm_maxbits =0; sindextemp = j; sindexcount = sindextemp.len(); this.__vmm_maxbits = sindextemp; vmm_data_member_scalar_packint(pack,sindexcount,this.__vmm_offset,0) vmm_data_member_scalar_pack(pack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) this.__vmm_maxbits =0; count = this._name[j].byte_pack(pack, this.__vmm_offset, this.__vmm_kind); end end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int start; int count; int index; string sindextemp; int sindexcount; string stemp; bit [31:0] size=0; index = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) this.__vmm_maxbits = 0; for (int j=0; j < size; j++) begin this.__vmm_maxbits = 0; vmm_data_member_scalar_unpackint(unpack,sindexcount,this.__vmm_offset,0) vmm_data_member_scalar_unpack(unpack,this.__vmm_maxbits,sindexcount,this.__vmm_offset) sindextemp = string'(this.__vmm_maxbits); this.__vmm_maxbits = 0; this._name[sindextemp] = new(); count = this._name[sindextemp].byte_unpack(unpack, this.__vmm_offset, this.__vmm_len, this.__vmm_kind); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin int size =0; string _prefix = this.__vmm_prefix; /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ size = $size(this._name); /* size = this._name.size(); */ for (int i = 0; i < size; i++) begin string pf; string _image = this.__vmm_image; $sformat(pf, `"%s _name[%0d]: `", _prefix, i); $sformat(this.__vmm_image, "%s\n%s", _image, this._name[i].psdisplay(pf)); if (i == 2 && size > 5 ) begin this.__vmm_image = {this.__vmm_image, "\n", _prefix, "..."}; i = size -3; end end this.__vmm_prefix = _prefix; end DO_COPY: begin case (_how & HOW_TO_COPY) DO_REFCOPY: begin __vmm_rhs._name = this._name; /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* for (int i=0; i __vmm_rhs._name[i] = this._name[i]; end end DO_DEEPCOPY: begin __vmm_rhs._name = this._name; /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* for (int i=0; i $cast(__vmm_rhs._name[i], this._name[i].copy()); end end endcase end DO_COMPARE: begin string diff; /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* if (this._name.size() != __vmm_rhs._name.size()) begin */ if ($size(this._name) != $size(__vmm_rhs._name)) begin string arr_size_str = $sformatf("%s.size()", SVT_DATA_UTIL_ARG_TO_STRING(_name)); $sformat( this.__vmm_image, `"\n DIFF /* arr_size_str, this._name.size(), arr_size_str, __vmm_rhs._name.size()); */ arr_size_str, $size(this._name), arr_size_str, $size(__vmm_rhs._name)); this.__vmm_status = 0; end case (_how & HOW_TO_COMPARE) DO_REFCOMPARE: begin /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* for (int i=0; i if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_DEEPCOMPARE: begin /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* for (int i=0; i if (!this._name[i].compare(__vmm_rhs._name[i],diff)) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]: %s`", i, i, diff); this.__vmm_status = 0; return; end end end endcase end DO_PACK: begin int start; int count; int exists; bit [31:0] size=0; start = this.__vmm_offset; vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits = 0; /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* for (int j=0; j count = 1; exists = (this._name[j] == null) ? 0 : 1; vmm_data_member_scalar_pack(pack,exists,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) if (exists) begin /* __vmm_offset is a static data member, potentially modified by the contained byte_pack */ /* Save away the current value and restore it after the byte_pack */ int saved_offset = this.__vmm_offset; count = this._name[j].byte_pack(pack, this.__vmm_offset, this.__vmm_kind); this.__vmm_offset = saved_offset; vmm_data_member_update_offset(this.__vmm_offset,count) end size++; end vmm_data_member_scalar_packint(pack,size,start,0) this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int exists; int start; int index; string stemp; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) vmm_data_member_update_offset(this.__vmm_offset,4) this.__vmm_maxbits =0; /* Watch out for the case where there is a mismatch between */ /* the array size and the unpack size. We cannot resize down */ /* but we want to at least generate an error message. */ /* This macro is only for fixed length array. Fixed length arrays does not support .size(), so enabling $size() and disabling .size() */ /* if (size < this._name.size()) begin */ if (size < $size(this._name)) begin if (this.log.start_msg(vmm_log::FAILURE_TYP, vmm_log::ERROR_SEV)) begin void'(this.log.text($sformatf("byte_unpack() - Mismatch between number of elements being unpacked (%0d) and destination array size (%0d). Unable to resize.", size, /*this._name.size()*/ $size(this._name)))); this.log.end_msg(); end end for (int j=0; j < size; j++) begin count = 1; vmm_data_member_scalar_unpack(unpack,exists,count,this.__vmm_offset) vmm_data_member_update_offset(this.__vmm_offset,count) if (exists) begin /* __vmm_offset is a static data member, potentially modified by the contained byte_unpack */ /* Save away the current value and restore it after the byte_unpack */ int saved_offset = this.__vmm_offset; this._name[j] = new(); count = this._name[j].byte_unpack(unpack, this.__vmm_offset, this.__vmm_len, this.__vmm_kind); this.__vmm_offset = saved_offset; vmm_data_member_update_offset(this.__vmm_offset,count) end else begin this._name[j] = null; end end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; for (int i = 0; i < this._name.size(); i++) begin if(this._name[i] != null ) begin string pf; $sformat(pf, `"%s``_name[%0d]: `", _prefix, i); $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(pf)); if (i == 2 && this._name.size() > 5) begin this.__vmm_image = {this.__vmm_image, `"\n`", _prefix, `"...`"}; i = this._name.size() - 3; end end end this.__vmm_prefix = _prefix; end DO_COPY: begin case (_how & HOW_TO_COPY) DO_REFCOPY: begin __vmm_rhs._name = new [this._name.size()]; foreach (this._name[i]) begin __vmm_rhs._name[i] = this._name[i]; end end DO_DEEPCOPY: begin __vmm_rhs._name = new [this._name.size()]; foreach(this._name[i]) begin if(this._name[i] != null ) begin $cast(__vmm_rhs._name[i], this._name[i].copy()); end end end endcase end DO_COMPARE: begin string diff; if (__vmm_rhs._name.size() !== this._name.size()) begin $sformat(this.__vmm_image, `"this._name.size() (%0d) !== to._name.size() (%0d)`", this._name.size(), __vmm_rhs._name.size()); this.__vmm_status = 0; return; end case (_how & HOW_TO_COMPARE) DO_REFCOMPARE: begin foreach (this._name[i]) begin if (this._name[i] != __vmm_rhs._name[i]) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]`", i, i); this.__vmm_status = 0; return; end end end DO_DEEPCOMPARE: begin foreach(this._name[i]) begin if(this._name[i] != null ) begin if (!this._name[i].compare(__vmm_rhs._name[i],diff)) begin $sformat(this.__vmm_image, `"this._name[%0d] !== to._name[%0d]: %s`", i, i, diff); this.__vmm_status = 0; return; end end end end endcase end DO_PACK: begin int start; int count; int index; int element; string stemp; bit [31:0] size=0; start = this.__vmm_offset; size = this._name.size(); vmm_data_member_scalar_packint(pack,size,start,0) this.__vmm_maxbits = 0; foreach (this._name[j]) begin if(this._name[j] != null ) begin count = this._name[j].byte_pack(pack, this.__vmm_offset, this.__vmm_kind); end end this.__vmm_len = this.__vmm_offset; end DO_UNPACK: begin int count; int start; int index; string stemp; bit [31:0] size = 0; start = this.__vmm_offset; vmm_data_member_scalar_unpackint(unpack,size,start,0) this.__vmm_maxbits =0; foreach (this._name[j]) begin this._name[j] = new(); count = this._name[j].byte_unpack(unpack, this.__vmm_offset, this.__vmm_len, this.__vmm_kind); end end endcase |
|
|
local virtual function string this_class_name(); return `"_class`"; endfunction local virtual function vmm_log get_vmm_log(); return this.log; endfunction virtual function vmm_data allocate(); _class i = new; return i; endfunction virtual function bit is_valid(bit silent = 1, int kind = -1); this.__vmm_done_user = 1; is_valid = this.do_is_valid(silent, kind); if (this.__vmm_done_user) return is_valid; return 1; endfunction virtual function string psdisplay(string prefix = `"`"); this.__vmm_done_user = 1; psdisplay = this.do_psdisplay(prefix); if (this.__vmm_done_user) return psdisplay; this.__vmm_prefix = prefix; this.do_all(DO_PRINT, __vmm_bytes, __vmm_bytes); return this.__vmm_image; endfunction virtual function vmm_data copy(vmm_data to = null); _class cpy; this.__vmm_done_user = 1; copy = this.do_copy(to); if (this.__vmm_done_user) return copy; if (to == null) cpy = new; else if (!$cast(cpy, to)) begin vmm_fatal(this.log, `"Cannot copy to non-_class instance`"); return null; end super.copy_data(cpy); this.__vmm_rhs = cpy; this.do_all(DO_COPY, __vmm_bytes, __vmm_bytes); return cpy; endfunction virtual function bit compare( vmm_data to, output string diff, input int kind = -1); _class cp; if (to == null) begin diff = `"'to' is NULL`"; return 0; end this.__vmm_done_user = 1; compare = this.do_compare(to, diff, kind); if (this.__vmm_done_user) return compare; if (!$cast(cp, to)) begin diff = `"'to' is not a _class instance`"; return 0; end this.__vmm_rhs = cp; this.__vmm_kind = kind; this.do_all(DO_COMPARE, __vmm_bytes, __vmm_bytes); diff = this.__vmm_image; return this.__vmm_status; endfunction virtual function int unsigned byte_pack(ref logic [7:0] bytes[], input int unsigned offset = 0, input int kind = -1); int min_size; this.__vmm_done_user = 1; byte_pack = this.do_byte_pack(bytes, offset, kind); if (this.__vmm_done_user) return byte_pack; min_size = offset + this.__vmm_byte_size(kind); if (bytes.size() < min_size) bytes = new [min_size] (bytes); this.__vmm_offset = offset; this.__vmm_kind = kind; this.do_all(DO_PACK, bytes, __vmm_bytes); return this.__vmm_offset - offset; endfunction virtual function int unsigned byte_unpack(const ref logic [7:0] bytes[], input int unsigned offset = 0, input int len = -1, input int kind = -1); this.__vmm_done_user = 1; byte_unpack = this.do_byte_unpack(bytes, offset, len, kind); if (this.__vmm_done_user) return byte_unpack; this.__vmm_offset = offset; this.__vmm_kind = kind; this.do_all(DO_UNPACK, __vmm_bytes, bytes); return this.__vmm_offset - offset; endfunction |
|
|
|
|
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
1
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::DEBUG_SEV) begin if (log.start_msg(vmm_log::DEBUG_TYP, vmm_log::DEBUG_SEV)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::DEBUG_TYP, vmm_log::DEBUG_SEV)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
_q = {}
|
|
|
If you get a syntax error on this line, the file is corrupt. Make sure you unpack the VMM distribution file with gunzip then tar, not a Windows tool |
|
|
|
vmm_env
|
|
|
|
|
|
function void do_all(vmm_env::do_what_e do_what, vmm_env::restart_e restart = vmm_env::FIRM); super.do_all(do_what, restart); |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); end DO_RESET: begin case (restart) vmm_env::FIRM: this._name.flush(); vmm_env::HARD: this._name.kill(); endcase end DO_VOTE: begin this.end_vote.register_channel(this._name); end endcase end |
|
|
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", this.__vmm_prefix, `"_name`", i))); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].flush(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_vote.register_channel(this._name[i]); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", this.__vmm_prefix, `"_name`", i))); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].flush(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_vote.register_channel(this._name[i]); end end endcase |
|
|
endfunction virtual function string psdisplay(string prefix = ""); this.__vmm_done_user = 1; psdisplay = this.do_psdisplay(prefix); if (this.__vmm_done_user) return psdisplay; this.__vmm_image = super.psdisplay(prefix); this.__vmm_prefix = prefix; if (vmm_str_match(prefix, ": $")) begin this.__vmm_prefix = {vmm_str_prematch(prefix), "."}; end this.do_all(DO_PRINT); return this.__vmm_image; endfunction virtual task start(); super.start(); this.__vmm_done_user = 1; this.do_vote(); if (!this.__vmm_done_user) begin this.do_all(DO_VOTE); end this.__vmm_done_user = 1; this.do_start(); if (this.__vmm_done_user) return; this.__vmm_forks = 0; this.do_all(DO_START); wait (this.__vmm_forks == 0); endtask virtual task stop(); super.stop(); this.__vmm_done_user = 1; this.do_stop(); if (this.__vmm_done_user) return; this.__vmm_forks = 0; this.do_all(DO_STOP); wait (this.__vmm_forks == 0); endtask virtual task reset_env(vmm_env::restart_e kind = vmm_env::FIRM); super.reset_env(kind); this.__vmm_done_user = 1; this.do_reset(kind); if (this.__vmm_done_user) return; this.end_vote.unregister_all(); this.__vmm_forks = 0; this.do_all(DO_RESET, kind); wait (this.__vmm_forks == 0); endtask |
|
|
vmm_xactor_member_enum(_name, _do) |
|
|
vmm_xactor_member_enum_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_enum_aa_string(_name, _do) |
|
|
vmm_xactor_member_enum_array(_name, _do) |
|
|
`define vmm_xactor_member_scalar(_name, _do) |
|
|
vmm_xactor_member_scalar_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_scalar_aa_string(_name, _do) |
|
|
vmm_xactor_member_scalar_array(_name, _do) |
|
|
vmm_xactor_member_string(_name, _do) |
|
|
vmm_xactor_member_string_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_string_aa_string(_name, _do) |
|
|
vmm_xactor_member_string_array(_name, _do) |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end DO_START: begin this.__vmm_forks++; fork begin this._name.start(); this.__vmm_forks--; end join_none end DO_STOP: begin this.__vmm_forks++; fork begin this._name.stop(); this.__vmm_forks--; end join_none end DO_RESET: begin this.__vmm_forks++; fork begin this._name.reset(restart); this.__vmm_forks--; end join_none end endcase end |
|
|
vmm_env_member_subenv_array(_name, _do) |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic string j = i; fork begin this._name[j].start(); this.__vmm_forks--; end join_none end end DO_STOP: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic string j = i; fork begin this._name[j].stop(); this.__vmm_forks--; end join_none end end DO_RESET: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].reset(restart); this.__vmm_forks--; end join_none end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].start(); this.__vmm_forks--; end join_none end end DO_STOP: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].stop(); this.__vmm_forks--; end join_none end end DO_RESET: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].reset(restart); this.__vmm_forks--; end join_none end end endcase |
|
|
this.__vmm_restart = restart; void'(this.do_``_name(do_what)); |
|
|
vmm_xactor_member_vmm_data(_name, _do) |
|
|
vmm_xactor_member_vmm_data_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_vmm_data_aa_string(_name, _do) |
|
|
vmm_xactor_member_vmm_data_array(_name, _do) |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end DO_START: begin this._name.start_xactor(); end DO_STOP: begin this._name.stop_xactor(); end DO_RESET: begin case (restart) vmm_env::FIRM: this._name.reset_xactor(vmm_xactor::SOFT_RST); vmm_env::HARD: this._name.kill(); endcase end DO_VOTE: begin this.end_vote.register_xactor(this._name); end endcase end |
|
|
vmm_env_member_xactor_array(_name, _do) |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin foreach (this._name[i]) begin this._name[i].start_xactor(); end end DO_STOP: begin foreach (this._name[i]) begin this._name[i].stop_xactor(); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].reset_xactor(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_vote.register_xactor(this._name[i]); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin foreach (this._name[i]) begin this._name[i].start_xactor(); end end DO_STOP: begin foreach (this._name[i]) begin this._name[i].stop_xactor(); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].reset_xactor(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_vote.register_xactor(this._name[i]); end end endcase |
|
|
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::ERROR_SEV) begin if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::ERROR_SEV)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::ERROR_SEV)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::FATAL_SEV) begin if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::FATAL_SEV)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::FATAL_SEV)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
class``_inject_item_scenario
|
|
|
vmm_log
|
|
|
|
|
`"x`"
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::NORMAL_SEV) begin if (log.start_msg(vmm_log::NOTE_TYP)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::NOTE_TYP)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
vmm_notify
|
|
|
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::DEBUG_SEV) begin if (log.start_msg(vmm_log::PROTOCOL_TYP)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::PROTOCOL_TYP)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::DEBUG_SEV) begin if (log.start_msg(vmm_log::REPORT_TYP)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::REPORT_TYP)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
|
|
|
vmm_scenario
|
|
|
class``_scenario
|
|
|
vmm_data
|
|
|
|
|
|
|
|
|
|
class``_scenario_election
|
|
|
class``_scenario_election_valid
|
|
|
vmm_scenario_gen_using(class_name, class_name``_channel, text) |
|
|
class``_scenario_gen
|
|
|
class``_scenario_gen_callbacks
|
|
|
class vmm_scenario_(class_name) extends VMM_SCENARIO; static VMM_LOG log = new(`"class_name`", "class"); rand class_name items[]; class_name using; local virtual function string this_class_name(); return `"vmm_scenario_(class_name)`"; endfunction: this_class_name local virtual function vmm_log get_vmm_log(); return this.log; endfunction local virtual function string __default_name(); return {"Undefined ", text, " Scenario"}; endfunction: __default_name virtual function string psdisplay(string prefix = ""); psdisplay = super.psdisplay(prefix); foreach (this.items[i]) begin string pfx; if (this.items[i] == null) continue; $sformat(pfx, "%s Item[%0d]: ", prefix, i); psdisplay = {psdisplay, "\n", this.items[i].psdisplay(pfx)}; end if (this.using != null) begin psdisplay = {psdisplay, "\n", this.using.psdisplay({prefix, " Using: "})}; end return psdisplay; endfunction constraint vmm_scenario_valid_(class_name) { items.size() == length; `ifdef VMM_SOLVE_BEFORE_SIZE solve length before items.size VMM_SOLVE_BEFORE_OPT; `endif } `ifdef VMM_NO_PARENT_ARG_IN_SS_SCENARIO function new(VMM_SCENARIO_NEW_ARGS); super.new(null VMM_SCENARIO_NEW_CALL); using = null; endfunction: new `else function new(VMM_SCENARIO parent = null VMM_SCENARIO_NEW_ARGS); super.new(parent VMM_SCENARIO_NEW_CALL); using = null; endfunction: new `endif virtual function vmm_data copy(vmm_data to = null); vmm_scenario_(class_name) cpy; if (to == null) cpy = new(); else if (!$cast(cpy, to)) begin vmm_fatal(this.log, {"Cannot copy to non-", VMM_MACRO_TO_STRING(vmm_scenario_(class_name)), " instance"}); return null; end void'(super.copy(cpy)); cpy.items = new [this.items.size()]; foreach (this.items[i]) begin if (this.items[i] == null) cpy.items[i] = null; else $cast(cpy.items[i], this.items[i].copy()); end if (this.using == null) cpy.using = null; else $cast(cpy.using, this.using.copy()); return cpy; endfunction: copy function void allocate_scenario(class_name using = null); this.items = new [this.get_max_length()]; foreach (this.items[i]) begin if (using == null) this.items[i] = new; else $cast(this.items[i], using.copy()); VMM_OBJECT_SET_PARENT(this.items[i], this) this.items[i].stream_id = this.stream_id; this.items[i].scenario_id = this.scenario_id; this.items[i].data_id = i; end endfunction: allocate_scenario function void fill_scenario(class_name using = null); int i; if (this.items.size() < this.get_max_length()) begin this.items = new [this.get_max_length()] (this.items); end foreach (this.items[i]) begin if (this.items[i] != null) continue; if (using == null) this.items[i] = new; else $cast(this.items[i], using.copy()); VMM_OBJECT_SET_PARENT(this.items[i], this) this.items[i].stream_id = this.stream_id; this.items[i].scenario_id = this.scenario_id; this.items[i].data_id = i; end endfunction: fill_scenario function void pre_randomize(); this.fill_scenario(this.using); endfunction: pre_randomize virtual task apply(channel_name channel, ref int unsigned n_insts); int i; for (i = 0; i < this.length; i++) begin class_name item; $cast(item, this.items[i].copy()); `ifndef VMM_GRAB_DISABLED channel.put(item,,this); `else channel.put(item); `endif end n_insts = this.length; endtask: apply endclass class vmm_inject_item_scenario_(class_name) extends vmm_scenario_(class_name); function new(class_name obj VMM_DATA_NEW_ARGS); super.new(VMM_DATA_NEW_CALL); this.items = new [1]; this.items[0] = obj; this.length = 1; this.repeated = 0; void'(this.define_scenario("Directed 'inject_obj()' transaction", 1)); endfunction: new virtual task apply(channel_name channel, ref int unsigned n_insts); `ifndef VMM_GRAB_DISABLED channel.put(this.items[0],,this); `else channel.put(this.items[0]); `endif n_insts = 1; endtask: apply endclass class vmm_atomic_scenario_(class_name) extends vmm_scenario_(class_name); int unsigned ATOMIC; constraint atomic_scenario { if (scenario_kind == ATOMIC) { length == 1; repeated == 0; } } function new(VMM_DATA_NEW_ARGS); super.new(VMM_DATA_NEW_CALL); this.ATOMIC = this.define_scenario("Atomic", 1); this.scenario_kind = this.ATOMIC; this.length = 1; endfunction: new virtual function string psdisplay(string prefix = ""); psdisplay = super.psdisplay(prefix); endfunction:psdisplay function void pre_randomize(); super.pre_randomize(); endfunction virtual task apply(channel_name channel, ref int unsigned n_insts); super.apply(channel, n_insts); endtask: apply endclass class vmm_scenario_election_(class_name); int stream_id; int scenario_id; int unsigned n_scenarios; int unsigned last_selected[$]; int unsigned next_in_set; vmm_scenario_(class_name) scenario_set[$]; rand int select; constraint vmm_scenario_election_valid_(class_name) { select >= 0; select < n_scenarios; } constraint round_robin { select == next_in_set; } endclass typedef class vmm_scenario_gen_(class_name); class vmm_scenario_gen_callbacks_(class_name) extends vmm_xactor_callbacks; virtual task pre_scenario_randomize(vmm_scenario_gen_(class_name) gen, ref vmm_scenario_(class_name) scenario); endtask virtual task post_scenario_gen(vmm_scenario_gen_(class_name) gen, vmm_scenario_(class_name) scenario, ref bit dropped); endtask endclass class vmm_scenario_gen_(class_name) extends VMM_XACTOR; int unsigned stop_after_n_insts; int unsigned stop_after_n_scenarios; typedef enum int {GENERATED, DONE} symbols_e; vmm_scenario_election_(class_name) select_scenario; vmm_scenario_(class_name) scenario_set[$]; protected vmm_scenario_(class_name) scenario_registry[string]; channel_name out_chan; protected int scenario_count; protected int inst_count; virtual function string psdisplay(string prefix = ""); psdisplay = super.psdisplay(prefix); $sformat(psdisplay, "%s [stops after #insts %0d>%0d or #scenarios %0d>%0d]", psdisplay, this.inst_count, this.stop_after_n_insts, this.scenario_count, this.stop_after_n_scenarios); $sformat(psdisplay, "%s\n%sOutChan: %s(%s) [level=%0d of %0d]", psdisplay, prefix, this.out_chan.log.get_name(), this.out_chan.log.get_instance(), this.out_chan.level(), this.out_chan.full_level()); foreach (this.scenario_registry[name]) begin psdisplay = {psdisplay, "\n", this.scenario_registry[name].psdisplay(prefix)}; end return psdisplay; endfunction: psdisplay function new(string inst, int stream_id = -1, channel_name out_chan = null VMM_XACTOR_NEW_ARGS); super.new({text, " Scenario Generator"}, inst, stream_id VMM_XACTOR_NEW_CALL); if (out_chan == null) begin out_chan = new({text, " Scenario Generator output channel"}, inst); VMM_OBJECT_SET_PARENT(out_chan, this) end this.out_chan = out_chan; this.out_chan.set_producer(this); this.log.is_above(this.out_chan.log); this.scenario_count = 0; this.inst_count = 0; this.stop_after_n_insts = 0; this.stop_after_n_scenarios = 0; this.select_scenario = new; begin vmm_atomic_scenario_(class_name) sc = new; VMM_OBJECT_SET_PARENT(sc, this) this.register_scenario("Atomic", sc); end void'(this.notify.configure(GENERATED)); void'(this.notify.configure(DONE, vmm_notify::ON_OFF)); endfunction: new virtual function void register_scenario(string name, vmm_scenario_(class_name) scenario); if(name == "") begin vmm_error(this.log, vmm_sformatf("Invalid '%s' string was passed", name)); return; end if(this.scenario_registry.exists(name)) begin vmm_error(this.log, vmm_sformatf("%s already has an entry in the scenario registry", name)); return; end if(scenario == null) begin vmm_error(this.log, vmm_sformatf("scenario passed for %s is a null value", name)); return; end this.scenario_registry[name] = scenario; foreach(this.scenario_set[i]) begin if(this.scenario_set[i] == scenario) return; end this.scenario_set.push_back(scenario); endfunction: register_scenario virtual function bit scenario_exists(string name); if(name == "") begin vmm_error(this.log, vmm_sformatf("Invalid '%s' string was passed", name)); return 0; end if(this.scenario_registry.exists(name)) scenario_exists = 1; else scenario_exists = 0; endfunction: scenario_exists virtual function void replace_scenario(string name, vmm_scenario_(class_name) scenario); if(name == "") begin vmm_error(this.log, vmm_sformatf("Invalid '%s' string was passed", name)); return; end if(scenario == null) begin vmm_error(this.log, vmm_sformatf("scenario passed for %s is a null value", name)); return; end if(!this.scenario_registry.exists(name)) begin vmm_error(this.log, vmm_sformatf("cannot replace a unregistered %s entry [use register_scenario]", name)); return ; end foreach(this.scenario_set[i]) begin if(this.scenario_set[i] == this.scenario_registry[name]) begin this.scenario_set.delete(i); break; end end this.scenario_registry[name] = scenario; foreach(this.scenario_set[i]) begin if(this.scenario_set[i] == scenario) return; end this.scenario_set.push_back(scenario); endfunction: replace_scenario virtual function void get_all_scenario_names(ref string name[$]); string s; if(this.scenario_registry.first(s)) begin do begin name.push_back(s); end while(this.scenario_registry.next(s)); end if(name.size() == 0) begin vmm_warning(this.log, "There are no entries in the scenario generator registry"); end endfunction: get_all_scenario_names virtual function void get_names_by_scenario(vmm_scenario_(class_name) scenario, ref string name[$]); string s; if(scenario == null) begin vmm_error(this.log, vmm_sformatf("scenario is a null value")); return; end if(this.scenario_registry.first(s)) begin do begin if(this.scenario_registry[s] == scenario) name.push_back(s); end while(this.scenario_registry.next(s)); end if(name.size() == 0) begin vmm_warning(this.log, "There are no entries in the scenario registry"); end endfunction: get_names_by_scenario virtual function string get_scenario_name(vmm_scenario_(class_name) scenario); string s[$]; if(scenario == null) begin vmm_error(this.log, vmm_sformatf("scenario is a null value")); return ""; end this.get_names_by_scenario(scenario, s); if(s.size()) get_scenario_name = s[0]; else get_scenario_name = ""; endfunction: get_scenario_name virtual function int get_scenario_index(vmm_scenario_(class_name) scenario); get_scenario_index = -1; foreach(this.scenario_set[i]) begin if(this.scenario_set[i] == scenario) begin return (get_scenario_index = i); end end if(get_scenario_index == -1) begin vmm_warning(this.log, vmm_sformatf("Cannot find the index for the scenario")); end endfunction: get_scenario_index virtual function bit unregister_scenario(vmm_scenario_(class_name) scenario); string s; unregister_scenario=0; if(scenario == null) begin vmm_error(this.log, vmm_sformatf("scenario is a null value")); return 0; end if(this.scenario_registry.first(s)) begin do begin if(this.scenario_registry[s] == scenario) begin this.scenario_registry.delete(s); unregister_scenario=1; end end while(this.scenario_registry.next(s)); end if(unregister_scenario==0) begin vmm_warning(this.log, "There are no entries in the scenario registry"); end if(unregister_scenario) begin foreach(this.scenario_set[i]) begin if(this.scenario_set[i] == scenario) begin this.scenario_set.delete(i); break; end end end endfunction: unregister_scenario virtual function vmm_scenario_(class_name) unregister_scenario_by_name(string name); if(name == "") begin vmm_error(this.log, vmm_sformatf("Invalid '%s' string was passed", name)); return null; end if(!this.scenario_registry.exists(name)) begin vmm_warning(this.log, vmm_sformatf("There is no entry for %s in the scenario registry", name)); return null; end else begin unregister_scenario_by_name = this.scenario_registry[name]; foreach(this.scenario_set[i]) begin if(this.scenario_set[i] == this.scenario_registry[name]) begin this.scenario_set.delete(i); break; end end this.scenario_registry.delete(name); end endfunction: unregister_scenario_by_name virtual function vmm_scenario_(class_name) get_scenario(string name); if(name == "") begin vmm_error(this.log, vmm_sformatf("Invalid '%s' string was passed", name)); return null; end if(!this.scenario_registry.exists(name)) begin vmm_error(this.log, vmm_sformatf("%s does not have an entry in the scenario registry", name)); return null; end get_scenario = this.scenario_registry[name]; if(get_scenario == null) vmm_warning(this.log, vmm_sformatf("%s has a null scenario associated with it in the scenario registry", name)); endfunction: get_scenario function int unsigned get_n_insts(); get_n_insts = this.inst_count; endfunction: get_n_insts function int unsigned get_n_scenarios(); get_n_scenarios = this.scenario_count; endfunction: get_n_scenarios virtual task inject_obj(class_name obj); vmm_inject_item_scenario_(class_name) scenario = new(obj); this.inject(scenario); endtask: inject_obj virtual task inject(vmm_scenario_(class_name) scenario); bit drop = 0; scenario.stream_id = this.stream_id; scenario.scenario_id = this.scenario_count; foreach (scenario.items[i]) begin scenario.items[i].stream_id = scenario.stream_id; scenario.items[i].scenario_id = scenario.scenario_id; scenario.items[i].data_id = i; end vmm_callback(vmm_scenario_gen_callbacks_(class_name), post_scenario_gen(this, scenario, drop)); if (!drop) begin this.scenario_count++; this.notify.indicate(GENERATED, scenario); if (scenario.repeated > scenario.repeat_thresh) begin vmm_warning(this.log, vmm_sformatf("A scenario will be repeated %0d times...", scenario.repeated)); end repeat (scenario.repeated + 1) begin int unsigned n_insts = 0; scenario.apply(this.out_chan, n_insts); this.inst_count += n_insts; end end endtask: inject virtual function void reset_xactor(vmm_xactor::reset_e rst_typ = SOFT_RST); super.reset_xactor(rst_typ); this.scenario_count = 0; this.inst_count = 0; this.out_chan.flush(); vmm_delQ(this.select_scenario.last_selected); if (rst_typ >= FIRM_RST) begin this.notify.reset( , vmm_notify::HARD); end if (rst_typ >= HARD_RST) begin vmm_atomic_scenario_(class_name) sc = new; VMM_OBJECT_SET_PARENT(sc, this) this.stop_after_n_insts = 0; this.stop_after_n_scenarios = 0; this.select_scenario = new; this.scenario_set.push_back(sc); end endfunction: reset_xactor virtual protected task main(); vmm_scenario_(class_name) the_scenario; fork super.main(); join_none if(this.scenario_set.size() == 0) return; while ((this.stop_after_n_insts <= 0 || this.inst_count < this.stop_after_n_insts) && (this.stop_after_n_scenarios <= 0 || this.scenario_count < this.stop_after_n_scenarios)) begin this.wait_if_stopped(); this.select_scenario.stream_id = this.stream_id; this.select_scenario.scenario_id = this.scenario_count; this.select_scenario.n_scenarios = this.scenario_set.size(); this.select_scenario.scenario_set = this.scenario_set; if (this.select_scenario.last_selected.size() == 0) this.select_scenario.next_in_set = 0; else this.select_scenario.next_in_set = ((this.select_scenario.last_selected[$] + 1) % this.scenario_set.size()); if (!this.select_scenario.randomize()) begin vmm_fatal(this.log, "Cannot select scenario descriptor"); continue; end if (this.select_scenario.select < 0 || this.select_scenario.select >= this.scenario_set.size()) begin vmm_fatal(this.log, vmm_sformatf("Select scenario #%0d is not within available set (0-%0d)", this.select_scenario.select, this.scenario_set.size()-1)); continue; end this.select_scenario.last_selected.push_back(this.select_scenario.select); while (this.select_scenario.last_selected.size() > 10) begin void'(this.select_scenario.last_selected.pop_front()); end the_scenario = this.scenario_set[this.select_scenario.select]; if (the_scenario == null) begin vmm_fatal(this.log, vmm_sformatf("Selected scenario #%0d does not exist", this.select_scenario.select)); continue; end the_scenario.stream_id = this.stream_id; the_scenario.scenario_id = this.scenario_count; foreach (the_scenario.items[i]) begin if (the_scenario.items[i] == null) continue; the_scenario.items[i].stream_id = the_scenario.stream_id; the_scenario.items[i].scenario_id = the_scenario.scenario_id; the_scenario.items[i].data_id = i; end vmm_callback(vmm_scenario_gen_callbacks_(class_name), pre_scenario_randomize(this, the_scenario)); if (the_scenario == null) continue; if (!the_scenario.randomize()) begin vmm_fatal(this.log, $psprintf("Cannot randomize scenario descriptor #%0d", this.select_scenario.select)); continue; end this.inject(the_scenario); end this.notify.indicate(DONE); this.notify.indicate(XACTOR_STOPPED); this.notify.indicate(XACTOR_IDLE); this.notify.reset(XACTOR_BUSY); endtask: main endclass |
|
|
|
|
endfunction `ifndef vmm_scenario_``_class``_new static VMM_LOG log = new(`"_class`", `"class`"); function new(VMM_SCENARIO parent = null); super.new(parent); endfunction `endif vmm_data_methods(_class) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case (do_what & _do) DO_PRINT: begin if ( _name == null ) begin $sformat(this.__vmm_image, `"%s\n%s%s: (null)`", this.__vmm_image, this.__vmm_prefix, `"_name`"); end else begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end end DO_COPY: begin if (_name == null) begin __vmm_rhs._name = this._name; end else begin $cast(__vmm_rhs._name, this._name.copy()); end end DO_COMPARE: begin if (_name == null || __vmm_rhs._name == null) begin if (this._name != __vmm_rhs._name) begin $sformat(this.__vmm_image, `"this._name !== to._name`"); this.__vmm_status = 0; return; end end else begin string diff; if (!this._name.compare(__vmm_rhs._name, diff)) begin $sformat(this.__vmm_image, `"this._name !== to._name: %s `", diff); this.__vmm_status = 0; return; end end end endcase |
|
|
|
|
|
|
|
|
|
|
class``_scenario_valid
|
|
|
$psprintf
|
|
|
|
static
|
|
|
vmm_str_backref(n+1)
|
|
|
vmm_str_match(str, regex)
|
|
|
vmm_str_postmatch()
|
|
|
vmm_str_prematch()
|
|
|
vmm_subenv
|
|
|
|
|
|
function void do_all(vmm_subenv::do_what_e do_what, vmm_env::restart_e restart = vmm_env::FIRM); super.do_all(do_what, restart); |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); end DO_RESET: begin case (restart) vmm_env::FIRM: this._name.flush(); vmm_env::HARD: this._name.kill(); endcase end DO_VOTE: begin this.end_test.register_channel(this._name); end endcase end |
|
|
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", this.__vmm_prefix, `"_name`", i))); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].flush(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_test.register_channel(this._name[i]); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", this.__vmm_prefix, `"_name`", i))); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].flush(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_test.register_channel(this._name[i]); end end endcase |
|
|
endfunction virtual function string psdisplay(string prefix = `"`"); this.__vmm_done_user = 1; psdisplay = this.do_psdisplay(prefix); if (this.__vmm_done_user) return psdisplay; this.__vmm_image = super.psdisplay(prefix); this.__vmm_prefix = prefix; if (vmm_str_match(prefix, ": $")) begin this.__vmm_prefix = {vmm_str_prematch(prefix), "."}; end this.do_all(DO_PRINT); return this.__vmm_image; endfunction virtual task start(); super.start(); this.__vmm_done_user = 1; this.do_vote(); if (!this.__vmm_done_user) begin this.do_all(DO_VOTE); end this.__vmm_done_user = 1; this.do_start(); if (this.__vmm_done_user) return; this.__vmm_forks = 0; this.do_all(DO_START); wait (this.__vmm_forks == 0); endtask virtual task stop(); super.stop(); this.__vmm_done_user = 1; this.do_stop(); if (this.__vmm_done_user) return; this.__vmm_forks = 0; this.do_all(DO_STOP); wait (this.__vmm_forks == 0); endtask virtual task reset(vmm_env::restart_e kind = vmm_env::FIRM); super.stop(); this.__vmm_done_user = 1; this.do_reset(kind); if (this.__vmm_done_user) return; this.__vmm_forks = 0; this.do_all(DO_RESET, kind); wait (this.__vmm_forks == 0); endtask |
|
|
vmm_xactor_member_enum(_name, _do) |
|
|
vmm_xactor_member_enum_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_enum_aa_string(_name, _do) |
|
|
vmm_xactor_member_enum_array(_name, _do) |
|
|
`define vmm_xactor_member_scalar(_name, _do) |
|
|
vmm_xactor_member_scalar_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_scalar_aa_string(_name, _do) |
|
|
vmm_xactor_member_scalar_array(_name, _do) |
|
|
vmm_xactor_member_string(_name, _do) |
|
|
vmm_xactor_member_string_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_string_aa_string(_name, _do) |
|
|
vmm_xactor_member_string_array(_name, _do) |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end DO_START: begin this.__vmm_forks++; fork begin this._name.start(); this.__vmm_forks--; end join_none end DO_STOP: begin this.__vmm_forks++; fork begin this._name.stop(); this.__vmm_forks--; end join_none end DO_RESET: begin this.__vmm_forks++; fork begin this._name.reset(restart); this.__vmm_forks--; end join_none end endcase end |
|
|
vmm_subenv_member_subenv_array(_name, _do) |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic string j = i; fork begin this._name[j].start(); this.__vmm_forks--; end join_none end end DO_STOP: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic string j = i; fork begin this._name[j].stop(); this.__vmm_forks--; end join_none end end DO_RESET: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].reset(restart); this.__vmm_forks--; end join_none end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].start(); this.__vmm_forks--; end join_none end end DO_STOP: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].stop(); this.__vmm_forks--; end join_none end end DO_RESET: begin this.__vmm_forks++; foreach (this._name[i]) begin automatic int j = i; fork begin this._name[j].reset(restart); this.__vmm_forks--; end join_none end end endcase |
|
|
this.__vmm_restart = restart; void'(this.do_``_name(do_what)); |
|
|
vmm_xactor_member_vmm_data(_name, _do) |
|
|
vmm_xactor_member_vmm_data_aa_scalar(_name, _do) |
|
|
vmm_xactor_member_vmm_data_aa_string(_name, _do) |
|
|
vmm_xactor_member_vmm_data_array(_name, _do) |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end DO_START: begin this._name.start_xactor(); end DO_STOP: begin this._name.stop_xactor(); end DO_RESET: begin case (restart) vmm_env::FIRM: this._name.reset_xactor(vmm_xactor::SOFT_RST); vmm_env::HARD: this._name.kill(); endcase end DO_VOTE: begin this.end_test.register_xactor(this._name); end endcase end |
|
|
vmm_subenv_member_xactor_array(_name, _do) |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin foreach (this._name[i]) begin this._name[i].start_xactor(); end end DO_STOP: begin foreach (this._name[i]) begin this._name[i].stop_xactor(); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].reset_xactor(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_test.register_xactor(this._name[i]); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", _prefix, `"_name`", i))); end this.__vmm_prefix = _prefix; end DO_START: begin foreach (this._name[i]) begin this._name[i].start_xactor(); end end DO_STOP: begin foreach (this._name[i]) begin this._name[i].stop_xactor(); end end DO_RESET: begin case (restart) vmm_env::FIRM: foreach (this._name[i]) begin this._name[i].reset_xactor(); end vmm_env::HARD: foreach (this._name[i]) begin this._name[i].kill(); end endcase end DO_VOTE: begin foreach (this._name[i]) begin this.end_test.register_xactor(this._name[i]); end end endcase |
|
|
|
|
|
class testclassname extends vmm_test; envclassname env; function new(); super.new(`"testclassname`", doc); endfunction static testclassname testclassname``_inst = new(); /* Indirection through doRun() is so that run()'s argument */ /* is called 'env' as in the base class, and the encapsulated */ /* code still sees 'env1'. */ task run(vmm_env env); doRun(env); endtask task doRun(vmm_env env1); $cast(env, env1); begin |
|
|
end endtask endclass: testclassname |
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::TRACE_SEV) begin if (log.start_msg(vmm_log::DEBUG_TYP, vmm_log::TRACE_SEV)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::DEBUG_TYP, vmm_log::TRACE_SEV)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::TRACE_SEV) begin if (log.start_msg(vmm_log::TRANSACTION_TYP)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::TRANSACTION_TYP)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
do begin /* synopsys translate_off */ string _msg; _msg = msg; if (log.start_msg(vmm_log::USER_TYP_``n)) begin void'(log.text(_msg)); log.end_msg(); end /* synopsys translate_on */ end while (0) |
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::VERBOSE_SEV) begin if (log.start_msg(vmm_log::DEBUG_TYP, vmm_log::VERBOSE_SEV)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::DEBUG_TYP, vmm_log::VERBOSE_SEV)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while (0) |
|
|
|
do begin /* synopsys translate_off */ if (log.get_verbosity() < vmm_log::WARNING_SEV) begin if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV)) begin void'(log.text(msg)); log.end_msg(); end end else if (log.get_instance() != "svt_silent_mode") begin string _msg; _msg = msg; if (log.start_msg(vmm_log::FAILURE_TYP, vmm_log::WARNING_SEV)) begin void'(log.text(_msg)); log.end_msg(); end end else begin /* In silent mode, so skipping the display */ end /* synopsys translate_on */ end while(0) |
|
|
vmm_xactor
|
|
|
|
|
|
function void do_all(vmm_xactor::do_what_e do_what, vmm_xactor::reset_e rst_typ = SOFT_RST); super.do_all(do_what, rst_typ); |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); end DO_RESET: begin this._name.flush(); end DO_KILL: begin this._name.kill(); end endcase end |
|
|
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", this.__vmm_prefix, `"_name`", i))); end end DO_RESET: begin foreach (this._name[i]) begin this._name[i].flush(); end end DO_KILL: begin foreach (this._name[i]) begin this._name[i].kill(); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", this.__vmm_prefix, `"_name`", i))); end end end DO_RESET: begin foreach (this._name[i]) begin this._name[i].flush(); end end DO_KILL: begin foreach (this._name[i]) begin this._name[i].kill(); end end endcase |
|
|
endfunction virtual function string psdisplay(string prefix = `"`"); this.__vmm_done_user = 1; psdisplay = this.do_psdisplay(prefix); if (this.__vmm_done_user) return psdisplay; this.__vmm_image = super.psdisplay(prefix); this.__vmm_prefix = prefix; if (vmm_str_match(prefix, ": $")) begin this.__vmm_prefix = {vmm_str_prematch(prefix), "."}; end this.do_all(DO_PRINT); return this.__vmm_image; endfunction virtual function void start_xactor(); super.start_xactor(); this.__vmm_done_user = 1; this.do_start_xactor(); if (this.__vmm_done_user) return; this.do_all(DO_START); endfunction virtual function void stop_xactor(); super.stop_xactor(); this.__vmm_done_user = 1; this.do_stop_xactor(); if (this.__vmm_done_user) return; this.do_all(DO_STOP); endfunction virtual function void reset_xactor(vmm_xactor::reset_e rst_typ = SOFT_RST); super.reset_xactor(rst_typ); this.__vmm_done_user = 1; this.do_reset_xactor(rst_typ); if (this.__vmm_done_user) return; this.do_all(DO_RESET, rst_typ); endfunction virtual function void kill(); super.kill(); this.__vmm_done_user = 1; this.do_kill_xactor(); if (this.__vmm_done_user) return; this.do_all(DO_KILL); endfunction |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s%s: %0s`", this.__vmm_image, this.__vmm_prefix, `"_name`", this._name.name()); end endcase |
|
|
`define vmm_xactor_member_enum_array(_name, _do) |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s%s[%s]: %s`", this.__vmm_image, this.__vmm_prefix, `"_name`", i, this._name[i].name()); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s%s[%0d]: %0s`", this.__vmm_image, this.__vmm_prefix, `"_name`", i, this._name[i].name()); end end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s%s: %0d`", this.__vmm_image, this.__vmm_prefix, `"_name`", this._name); end endcase |
|
|
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s%s[%s]: %0d`", this.__vmm_image, this.__vmm_prefix, `"_name`", i, this._name[i]); end end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s%s[%0d]: %0d`", this.__vmm_image, this.__vmm_prefix, `"_name`", i, this._name[i]); end end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s%s: %s`", this.__vmm_image, this.__vmm_prefix, `"_name`", this._name); end endcase |
|
|
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s%s[%s]: %s`", this.__vmm_image, this.__vmm_prefix, `"_name`", i, this._name[i]); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s%s[%0d]: %s`", this.__vmm_image, this.__vmm_prefix, `"_name`", i, this._name[i]); end end endcase |
|
|
void'(this.do_``_name(do_what, rst_typ)); |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); end endcase end |
|
|
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", this.__vmm_prefix, `"_name`", i))); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", this.__vmm_prefix, `"_name`", i))); end end end endcase |
|
|
if(_name != null) begin case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name.psdisplay({this.__vmm_prefix, `"_name: `"})); this.__vmm_prefix = _prefix; end DO_START: begin this._name.start_xactor(); end DO_STOP: begin this._name.stop_xactor(); end DO_RESET: begin this._name.reset_xactor(rst_typ); end DO_KILL: begin this._name.kill(); end endcase end |
|
|
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%s]: ", _prefix, `"_name`", i))); end end this.__vmm_prefix = _prefix; end DO_START: begin foreach (this._name[i]) begin this._name[i].start_xactor(); end end DO_STOP: begin foreach (this._name[i]) begin this._name[i].stop_xactor(); end end DO_RESET: begin foreach (this._name[i]) begin this._name[i].reset_xactor(rst_typ); end end DO_KILL: begin foreach (this._name[i]) begin this._name[i].kill(); end end endcase |
|
|
case (do_what & _do) DO_PRINT: begin string _prefix = this.__vmm_prefix; foreach (this._name[i]) begin if (this._name[i] != null) begin $sformat(this.__vmm_image, `"%s\n%s`", this.__vmm_image, this._name[i].psdisplay(vmm_sformatf("%s%s[%0d]: ", _prefix, `"_name`", i))); end end end this.__vmm_prefix = _prefix; end DO_START: begin foreach (this._name[i]) begin this._name[i].start_xactor(); end end DO_STOP: begin foreach (this._name[i]) begin this._name[i].stop_xactor(); end end DO_RESET: begin foreach (this._name[i]) begin this._name[i].reset_xactor(rst_typ); end end DO_KILL: begin foreach (this._name[i]) begin this._name[i].kill(); end end endcase |
|
|
|