diff --git a/CLAUDE.md b/CLAUDE.md index 688f6e3..1f1796f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -**uvmkit_check** is a SystemVerilog assertion library inspired by JUnit Assert. It provides a comprehensive set of macros for validating test conditions in verification environments, supporting both UVM and non-UVM workflows across multiple simulators. +**uvmkit_assert** is a SystemVerilog assertion library inspired by JUnit Assert. It provides a comprehensive set of macros for validating test conditions in verification environments, supporting both UVM and non-UVM workflows across multiple simulators. ### Design Philosophy @@ -18,7 +18,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ### Core Components -#### 1. Configuration Layer (`src/uvmkit_check.sv` lines 1-98) +#### 1. Configuration Layer (`src/uvmkit_assert.sv` lines 1-98) **Purpose**: Provides customizable infrastructure for error reporting and stacktraces. @@ -29,7 +29,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co **Design Pattern**: Uses `ifndef` guards to allow external overrides for testing and simulator customization. -#### 2. Assertion Groups (`src/uvmkit_check.sv` lines 100-628) +#### 2. Assertion Groups (`src/uvmkit_assert.sv` lines 100-628) Organized by functionality (mirroring JUnit organization): @@ -47,7 +47,7 @@ Organized by functionality (mirroring JUnit organization): **Design Pattern**: Each macro follows this structure: ```systemverilog -`define uvmkit_check_(, msg="") \ +`define uvmkit_assert_(, msg="") \ begin \ // 1. Declare automatic variables for evaluation // 2. Evaluate expressions once (avoid multiple evaluation side effects) @@ -76,7 +76,7 @@ The library uses preprocessor directives to adapt to different environments: ### Testing Infrastructure -#### Unit Tests (`tests/unit/uvmkit_check_unit_test.sv`) +#### Unit Tests (`tests/unit/uvmkit_assert_unit_test.sv`) **Strategy**: Override `uvmkit_error_msg` to capture errors for validation. @@ -89,16 +89,16 @@ string last_msg; error_called = 1; \ last_msg = msg; -`include "uvmkit_check.sv" +`include "uvmkit_assert.sv" // Test both success and failure paths `SVTEST(test_check_equals) error_called = 0; - `uvmkit_check_equals(5, 5, "should pass") + `uvmkit_assert_equals(5, 5, "should pass") `FAIL_IF(error_called) // Success: no error error_called = 0; - `uvmkit_check_equals(5, 3, "should fail") + `uvmkit_assert_equals(5, 3, "should fail") `FAIL_UNLESS(error_called) // Failure: error called `SVTEST_END ``` @@ -155,9 +155,9 @@ This project follows **Natural Docs** style, similar to UVM documentation: ### Code Style #### Macro Naming Convention -- Prefix: `uvmkit_check_` -- Format: `uvmkit_check_[_]` -- Examples: `uvmkit_check_equals`, `uvmkit_check_equals_real`, `uvmkit_check_equals_uvm` +- Prefix: `uvmkit_assert_` +- Format: `uvmkit_assert_[_]` +- Examples: `uvmkit_assert_equals`, `uvmkit_assert_equals_real`, `uvmkit_assert_equals_uvm` #### Internal Variables - Prefix with underscore: `_exp_result`, `_a_str` @@ -202,7 +202,7 @@ runSVUnit -c -Wno-WIDTH -o obj_dir \ ```systemverilog //------------------------------------------------------------------------------ -// Macro: uvmkit_check_range +// Macro: uvmkit_assert_range // // Asserts that a value falls within a specified range [min, max] inclusive. // @@ -213,16 +213,16 @@ runSVUnit -c -Wno-WIDTH -o obj_dir \ // msg - Optional message providing context (default: "") // // Example: -// | `uvmkit_check_range(temperature, -40, 125, "Temperature out of spec") -// | `uvmkit_check_range(count, 0, 100, "Count must be 0-100") +// | `uvmkit_assert_range(temperature, -40, 125, "Temperature out of spec") +// | `uvmkit_assert_range(count, 0, 100, "Count must be 0-100") // -`define uvmkit_check_range(value, min, max, msg="") \ +`define uvmkit_assert_range(value, min, max, msg="") \ begin \ automatic int _value = value; \ automatic int _min = min; \ automatic int _max = max; \ if (_value < _min || _value > _max) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_range", \ + `uvmkit_error_msg_fmt("uvmkit_assert_range", \ $sformatf("Expected '%s' (%0d) to be in range [%0d, %0d]", \ `"value`", _value, _min, _max), msg) \ end \ @@ -288,13 +288,13 @@ Examples: **Problem**: Floating-point precision makes exact equality unreliable. -**Solution**: Always use `uvmkit_check_equals_real` with appropriate delta: +**Solution**: Always use `uvmkit_assert_equals_real` with appropriate delta: ```systemverilog // Bad -`uvmkit_check_equals(voltage, 3.3, "voltage check") // Don't do this with reals +`uvmkit_assert_equals(voltage, 3.3, "voltage check") // Don't do this with reals // Good -`uvmkit_check_equals_real(3.3, voltage, 0.01, "voltage check") +`uvmkit_assert_equals_real(3.3, voltage, 0.01, "voltage check") ``` ## Build System @@ -333,8 +333,8 @@ Examples: ### Potential Additions 1. **Array Assertions** - - `uvmkit_check_array_equals` - - `uvmkit_check_array_contains` + - `uvmkit_assert_array_equals` + - `uvmkit_assert_array_contains` 2. **Size Information in Errors** - Show bit widths when X-value comparisons fail @@ -345,7 +345,7 @@ Examples: - User-configurable via macro override 4. **Performance Assertions** - - `uvmkit_check_time_limit` - Execution time bounds + - `uvmkit_assert_time_limit` - Execution time bounds - Cycle count validation 5. **Coverage Integration** @@ -361,8 +361,8 @@ Examples: ### Internal Documentation - `README.md` - User-facing documentation -- `src/uvmkit_check.sv` - Source code with Natural Docs comments -- `tests/unit/uvmkit_check_unit_test.sv` - Test examples +- `src/uvmkit_assert.sv` - Source code with Natural Docs comments +- `tests/unit/uvmkit_assert_unit_test.sv` - Test examples ## Debugging Tips @@ -382,7 +382,7 @@ string captured_errors[$]; `define uvmkit_error_msg(typ, msg) \ captured_errors.push_back($sformatf("[%s] %s", typ, msg)); -`include "uvmkit_check.sv" +`include "uvmkit_assert.sv" // Now all errors are captured in captured_errors queue ``` diff --git a/README.md b/README.md index 4c66d55..ca3e4cd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# uvmkit_check +# uvmkit_assert **A comprehensive set of assertion macros for SystemVerilog verification**, inspired by [JUnit Assert](https://junit.org/junit4/javadoc/4.13.2/org/junit/Assert.html). -uvmkit_check provides a familiar and powerful way to validate test conditions in both UVM and non-UVM environments. Only failed assertions produce output, keeping simulation logs clean and focused on actual failures. +uvmkit_assert provides a familiar and powerful way to validate test conditions in both UVM and non-UVM environments. Only failed assertions produce output, keeping simulation logs clean and focused on actual failures. ## Features @@ -21,7 +21,7 @@ uvmkit_check provides a familiar and powerful way to validate test conditions in ```systemverilog // Include the library -`include "uvmkit_check.sv" +`include "uvmkit_assert.sv" module my_test; initial begin @@ -30,18 +30,18 @@ module my_test; string name = "my_component"; // Boolean assertions - `uvmkit_check_true(ready, "Ready signal must be high") - `uvmkit_check_false(error, "No errors should occur") + `uvmkit_assert_true(ready, "Ready signal must be high") + `uvmkit_assert_false(error, "No errors should occur") // Equality assertions - `uvmkit_check_equals(data, 8'hA5, "Data mismatch") - `uvmkit_check_not_equals(count, 0, "Count should be non-zero") + `uvmkit_assert_equals(data, 8'hA5, "Data mismatch") + `uvmkit_assert_not_equals(count, 0, "Count should be non-zero") // String assertions - `uvmkit_check_equals_string(name, "my_component", "Name mismatch") + `uvmkit_assert_equals_string(name, "my_component", "Name mismatch") // Null checks - `uvmkit_check_not_null(my_object, "Object must exist") + `uvmkit_assert_not_null(my_object, "Object must exist") end endmodule ``` @@ -51,7 +51,7 @@ endmodule ```systemverilog `include "uvm_macros.svh" import uvm_pkg::*; -`include "uvmkit_check.sv" +`include "uvmkit_assert.sv" class my_test extends uvm_test; `uvm_component_utils(my_test) @@ -60,20 +60,20 @@ class my_test extends uvm_test; my_transaction expected, actual; // UVM object comparison using compare() - `uvmkit_check_equals_uvm(expected, actual, "Transaction mismatch") + `uvmkit_assert_equals_uvm(expected, actual, "Transaction mismatch") // All other assertions work the same - `uvmkit_check_equals(actual.addr, 32'h1000, "Address incorrect") + `uvmkit_assert_equals(actual.addr, 32'h1000, "Address incorrect") endfunction endclass ``` ## Installation -1. Copy `src/uvmkit_check.sv` to your project +1. Copy `src/uvmkit_assert.sv` to your project 2. Include it in your testbench: ```systemverilog - `include "uvmkit_check.sv" + `include "uvmkit_assert.sv" ``` That's it! The library is header-only (macro-based) with no additional dependencies. @@ -84,63 +84,63 @@ That's it! The library is header-only (macro-based) with no additional dependenc | Macro | Description | |-------|-------------| -| `uvmkit_check_fail(msg)` | Forces unconditional test failure | +| `uvmkit_assert_fail(msg)` | Forces unconditional test failure | ### Boolean Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_true(exp, msg)` | Asserts expression evaluates to true (non-zero) | -| `uvmkit_check_false(exp, msg)` | Asserts expression evaluates to false (zero) | +| `uvmkit_assert_true(exp, msg)` | Asserts expression evaluates to true (non-zero) | +| `uvmkit_assert_false(exp, msg)` | Asserts expression evaluates to false (zero) | ### Equality Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_equals(a, b, msg)` | Asserts two values are equal using case equality (===) | -| `uvmkit_check_not_equals(a, b, msg)` | Asserts two values are not equal using case inequality (!==) | +| `uvmkit_assert_equals(a, b, msg)` | Asserts two values are equal using case equality (===) | +| `uvmkit_assert_not_equals(a, b, msg)` | Asserts two values are not equal using case inequality (!==) | ### Null Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_null(obj, msg)` | Asserts object handle is null | -| `uvmkit_check_not_null(obj, msg)` | Asserts object handle is not null | +| `uvmkit_assert_null(obj, msg)` | Asserts object handle is null | +| `uvmkit_assert_not_null(obj, msg)` | Asserts object handle is not null | ### Identity Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_same(a, b, msg)` | Asserts two handles refer to the same object instance | -| `uvmkit_check_not_same(a, b, msg)` | Asserts two handles refer to different object instances | +| `uvmkit_assert_same(a, b, msg)` | Asserts two handles refer to the same object instance | +| `uvmkit_assert_not_same(a, b, msg)` | Asserts two handles refer to different object instances | ### Real Number Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_equals_real(expected, actual, delta, msg)` | Asserts real values are equal within tolerance | -| `uvmkit_check_not_equals_real(expected, actual, delta, msg)` | Asserts real values differ by more than tolerance | +| `uvmkit_assert_equals_real(expected, actual, delta, msg)` | Asserts real values are equal within tolerance | +| `uvmkit_assert_not_equals_real(expected, actual, delta, msg)` | Asserts real values differ by more than tolerance | ### Enum Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_equals_enum(enum_t, expected, actual, msg)` | Asserts enum values are equal | -| `uvmkit_check_not_equals_enum(enum_t, expected, actual, msg)` | Asserts enum values are not equal | +| `uvmkit_assert_equals_enum(enum_t, expected, actual, msg)` | Asserts enum values are equal | +| `uvmkit_assert_not_equals_enum(enum_t, expected, actual, msg)` | Asserts enum values are not equal | ### String Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_equals_string(a, b, msg)` | Asserts strings are equal (case-sensitive) | -| `uvmkit_check_not_equals_string(a, b, msg)` | Asserts strings are not equal | +| `uvmkit_assert_equals_string(a, b, msg)` | Asserts strings are equal (case-sensitive) | +| `uvmkit_assert_not_equals_string(a, b, msg)` | Asserts strings are not equal | ### UVM Object Assertions | Macro | Description | |-------|-------------| -| `uvmkit_check_equals_uvm(a, b, msg)` | Asserts UVM objects are equal using compare() | -| `uvmkit_check_not_equals_uvm(a, b, msg)` | Asserts UVM objects are not equal using compare() | +| `uvmkit_assert_equals_uvm(a, b, msg)` | Asserts UVM objects are equal using compare() | +| `uvmkit_assert_not_equals_uvm(a, b, msg)` | Asserts UVM objects are not equal using compare() | *Note: UVM assertions only available when UVM is included* @@ -152,9 +152,9 @@ That's it! The library is header-only (macro-based) with no additional dependenc bit enable = 1'b1; bit [3:0] status = 4'b0000; -`uvmkit_check_true(enable, "Enable must be high") -`uvmkit_check_true(count > 0, "Count must be positive") -`uvmkit_check_false(status[0], "Error bit must be clear") +`uvmkit_assert_true(enable, "Enable must be high") +`uvmkit_assert_true(count > 0, "Count must be positive") +`uvmkit_assert_false(status[0], "Error bit must be clear") ``` ### Equality with X/Z Handling @@ -164,7 +164,7 @@ bit [3:0] status = 4'b0000; logic [7:0] data = 8'bxxxx_1010; logic [7:0] expected = 8'bxxxx_1010; -`uvmkit_check_equals(data, expected, "Match including X states") +`uvmkit_assert_equals(data, expected, "Match including X states") ``` ### Real Number Comparisons @@ -175,7 +175,7 @@ real target = 3.300; real tolerance = 0.05; // Passes: |3.301 - 3.300| = 0.001 < 0.05 -`uvmkit_check_equals_real(target, voltage, tolerance, "Voltage in range") +`uvmkit_assert_equals_real(target, voltage, tolerance, "Voltage in range") ``` ### Enum Comparisons @@ -184,7 +184,7 @@ real tolerance = 0.05; typedef enum {IDLE, ACTIVE, ERROR} state_t; state_t current_state = IDLE; -`uvmkit_check_equals_enum(state_t, IDLE, current_state, "Should be IDLE") +`uvmkit_assert_equals_enum(state_t, IDLE, current_state, "Should be IDLE") // Error output includes enum names: "Expected IDLE but got ACTIVE" ``` @@ -196,8 +196,8 @@ obj_a = new(); obj_b = obj_a; // Same object obj_c = new(); // Different object -`uvmkit_check_same(obj_a, obj_b, "Should reference same object") // PASS -`uvmkit_check_not_same(obj_a, obj_c, "Should be different objects") // PASS +`uvmkit_assert_same(obj_a, obj_b, "Should reference same object") // PASS +`uvmkit_assert_not_same(obj_a, obj_c, "Should be different objects") // PASS ``` ## Simulator Compatibility @@ -217,9 +217,9 @@ obj_c = new(); // Different object For simulators with different stacktrace commands: ```systemverilog -// Before including uvmkit_check.sv +// Before including uvmkit_assert.sv `define uvmkit_stacktrace $callstack(); -`include "uvmkit_check.sv" +`include "uvmkit_assert.sv" ``` ### Error Reporting @@ -233,18 +233,18 @@ The library automatically detects UVM and uses the appropriate error mechanism: If you're familiar with JUnit, here's the mapping: -| JUnit Assert | uvmkit_check | Notes | +| JUnit Assert | uvmkit_assert | Notes | |--------------|--------------|-------| -| `fail()` | `uvmkit_check_fail()` | Unconditional failure | -| `assertTrue()` | `uvmkit_check_true()` | Boolean validation | -| `assertFalse()` | `uvmkit_check_false()` | Boolean validation | -| `assertEquals()` | `uvmkit_check_equals()` | Case equality (===) | -| `assertNotEquals()` | `uvmkit_check_not_equals()` | Case inequality (!==) | -| `assertNull()` | `uvmkit_check_null()` | Null check | -| `assertNotNull()` | `uvmkit_check_not_null()` | Not null check | -| `assertSame()` | `uvmkit_check_same()` | Reference equality | -| `assertNotSame()` | `uvmkit_check_not_same()` | Reference inequality | -| `assertEquals(double, delta)` | `uvmkit_check_equals_real()` | Floating-point with tolerance | +| `fail()` | `uvmkit_assert_fail()` | Unconditional failure | +| `assertTrue()` | `uvmkit_assert_true()` | Boolean validation | +| `assertFalse()` | `uvmkit_assert_false()` | Boolean validation | +| `assertEquals()` | `uvmkit_assert_equals()` | Case equality (===) | +| `assertNotEquals()` | `uvmkit_assert_not_equals()` | Case inequality (!==) | +| `assertNull()` | `uvmkit_assert_null()` | Null check | +| `assertNotNull()` | `uvmkit_assert_not_null()` | Not null check | +| `assertSame()` | `uvmkit_assert_same()` | Reference equality | +| `assertNotSame()` | `uvmkit_assert_not_same()` | Reference inequality | +| `assertEquals(double, delta)` | `uvmkit_assert_equals_real()` | Floating-point with tolerance | ## Advanced Usage @@ -254,13 +254,13 @@ The `msg` parameter is always optional but recommended: ```systemverilog // Less helpful - just shows what failed -`uvmkit_check_equals(data, expected) +`uvmkit_assert_equals(data, expected) // More helpful - provides context -`uvmkit_check_equals(data, expected, "AXI read data mismatch at address 0x1000") +`uvmkit_assert_equals(data, expected, "AXI read data mismatch at address 0x1000") // Dynamic messages -`uvmkit_check_true(valid, $sformatf("Cycle %0d: valid must be high", cycle)) +`uvmkit_assert_true(valid, $sformatf("Cycle %0d: valid must be high", cycle)) ``` ## Development @@ -280,6 +280,6 @@ runSVUnit -c -Wno-WIDTH -o obj_dir ## Documentation -- **Source Documentation**: Natural Docs style comments in `src/uvmkit_check.sv` +- **Source Documentation**: Natural Docs style comments in `src/uvmkit_assert.sv` - **API Reference**: See [Assertion Reference](#assertion-reference) above - **Examples**: See [examples/](examples/) directory diff --git a/src/uvmkit_check.sv b/src/uvmkit_assert.sv similarity index 69% rename from src/uvmkit_check.sv rename to src/uvmkit_assert.sv index 387d23e..fa6e76c 100644 --- a/src/uvmkit_check.sv +++ b/src/uvmkit_assert.sv @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ -// Title: uvmkit_check - SystemVerilog Assertion Macros +// Title: uvmkit_assert - SystemVerilog Assertion Macros //------------------------------------------------------------------------------ -// File: uvmkit_check.sv +// File: uvmkit_assert.sv // // A comprehensive set of assertion macros for SystemVerilog verification. // Inspired by JUnit Assert, these macros provide a familiar and powerful way @@ -14,9 +14,9 @@ // across multiple simulators including Verilator, Questa, VCS, and Xcelium. // // Example Usage: -// | `uvmkit_check_true(enable_signal, "Enable must be high") -// | `uvmkit_check_equals(expected_data, actual_data, "Data mismatch") -// | `uvmkit_check_not_null(obj, "Object cannot be null") +// | `uvmkit_assert_true(enable_signal, "Enable must be high") +// | `uvmkit_assert_equals(expected_data, actual_data, "Data mismatch") +// | `uvmkit_assert_not_null(obj, "Object cannot be null") // // Simulator Compatibility: // The library automatically adapts to the target simulator using conditional @@ -86,7 +86,7 @@ // Unconditional test failure macro. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_fail +// Macro: uvmkit_assert_fail // // Forces a test failure with an optional message. Use this when a condition // indicates the test should not continue or when a code path that should be @@ -99,11 +99,11 @@ // | case (opcode) // | ADD: process_add(); // | SUB: process_sub(); -// | default: `uvmkit_check_fail("Invalid opcode") +// | default: `uvmkit_assert_fail("Invalid opcode") // | endcase // -`define uvmkit_check_fail(msg="") \ - `uvmkit_error_msg_fmt("uvmkit_check_fail", "called", msg) +`define uvmkit_assert_fail(msg="") \ + `uvmkit_error_msg_fmt("uvmkit_assert_fail", "called", msg) //------------------------------------------------------------------------------ // Group: Boolean Assertions @@ -111,7 +111,7 @@ // Assertions for validating boolean expressions and conditions. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_true +// Macro: uvmkit_assert_true // // Asserts that the given expression evaluates to true (non-zero). // The expression is reduced using bitwise OR to handle multi-bit values. @@ -122,21 +122,21 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_true(data_valid, "Data valid signal must be high") -// | `uvmkit_check_true(count > 0, "Count must be positive") -// | `uvmkit_check_true(status[0], "LSB of status must be set") +// | `uvmkit_assert_true(data_valid, "Data valid signal must be high") +// | `uvmkit_assert_true(count > 0, "Count must be positive") +// | `uvmkit_assert_true(status[0], "LSB of status must be set") // -`define uvmkit_check_true(exp, msg="") \ +`define uvmkit_assert_true(exp, msg="") \ begin \ automatic logic _exp_result; \ _exp_result = |(exp); \ if (_exp_result !== 1'b1) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_true", $sformatf("Expected this expression '%s' to be true, but got 'b%0b", `"exp`", _exp_result), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_true", $sformatf("Expected this expression '%s' to be true, but got 'b%0b", `"exp`", _exp_result), msg) \ end \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_false +// Macro: uvmkit_assert_false // // Asserts that the given expression evaluates to false (zero). // The expression is reduced using bitwise OR to handle multi-bit values. @@ -147,16 +147,16 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_false(error_flag, "No errors should be flagged") -// | `uvmkit_check_false(count == 0, "Count should not be zero") -// | `uvmkit_check_false(busy, "Module should not be busy") +// | `uvmkit_assert_false(error_flag, "No errors should be flagged") +// | `uvmkit_assert_false(count == 0, "Count should not be zero") +// | `uvmkit_assert_false(busy, "Module should not be busy") // -`define uvmkit_check_false(exp, msg="") \ +`define uvmkit_assert_false(exp, msg="") \ begin \ automatic logic _exp_result; \ _exp_result = |(exp); \ if (_exp_result !== 1'b0) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_false", $sformatf("Expected this expression '%s' to be false, but got 'b%0b", `"exp`", _exp_result), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_false", $sformatf("Expected this expression '%s' to be false, but got 'b%0b", `"exp`", _exp_result), msg) \ end \ end @@ -167,7 +167,7 @@ // Uses case equality (===, !==) to properly handle X and Z values. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_equals +// Macro: uvmkit_assert_equals // // Asserts that two values are equal using case equality (===). // This checks for exact equality including X and Z states. @@ -179,21 +179,21 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_equals(expected_data, actual_data, "Data mismatch") -// | `uvmkit_check_equals(state, IDLE, "State should be IDLE") -// | `uvmkit_check_equals(addr[7:0], 8'hA5, "Address lower byte incorrect") +// | `uvmkit_assert_equals(expected_data, actual_data, "Data mismatch") +// | `uvmkit_assert_equals(state, IDLE, "State should be IDLE") +// | `uvmkit_assert_equals(addr[7:0], 8'hA5, "Address lower byte incorrect") // -`define uvmkit_check_equals(a, b, msg="") \ +`define uvmkit_assert_equals(a, b, msg="") \ begin \ automatic logic _exp_result; \ _exp_result = (a) === (b); \ if (_exp_result !== 1'b1) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_equals", $sformatf("Expected '%s', but ('b%0b) === ('b%0b) is 'b%0b", `"(a) === (b)`", (a), (b), _exp_result), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_equals", $sformatf("Expected '%s', but ('b%0b) === ('b%0b) is 'b%0b", `"(a) === (b)`", (a), (b), _exp_result), msg) \ end \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_equals +// Macro: uvmkit_assert_not_equals // // Asserts that two values are not equal using case inequality (!==). // This checks that values differ in at least one bit position. @@ -205,16 +205,16 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_not_equals(new_val, old_val, "Value should have changed") -// | `uvmkit_check_not_equals(id_a, id_b, "IDs must be unique") -// | `uvmkit_check_not_equals(status, ERROR, "Status should not be ERROR") +// | `uvmkit_assert_not_equals(new_val, old_val, "Value should have changed") +// | `uvmkit_assert_not_equals(id_a, id_b, "IDs must be unique") +// | `uvmkit_assert_not_equals(status, ERROR, "Status should not be ERROR") // -`define uvmkit_check_not_equals(a, b, msg="") \ +`define uvmkit_assert_not_equals(a, b, msg="") \ begin \ automatic logic _exp_result; \ _exp_result = (a) !== (b); \ if (_exp_result !== 1'b1) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_equals", $sformatf("Expected '%s', but ('b%0b) !== ('b%0b) is 'b%0b", `"(a) !== (b)`", (a), (b), _exp_result), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_equals", $sformatf("Expected '%s', but ('b%0b) !== ('b%0b) is 'b%0b", `"(a) !== (b)`", (a), (b), _exp_result), msg) \ end \ end @@ -224,7 +224,7 @@ // Assertions for validating object handle null states. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_null +// Macro: uvmkit_assert_null // // Asserts that an object handle is null. // Fails if the handle points to a valid object. @@ -234,16 +234,16 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_null(optional_config, "Config should not be set") -// | `uvmkit_check_null(deleted_obj, "Object should have been deleted") +// | `uvmkit_assert_null(optional_config, "Config should not be set") +// | `uvmkit_assert_null(deleted_obj, "Object should have been deleted") // -`define uvmkit_check_null(obj, msg="") \ +`define uvmkit_assert_null(obj, msg="") \ if ((obj) != null) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_null", $sformatf("Expected '%s' to be null, but it is not null", `"obj`"), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_null", $sformatf("Expected '%s' to be null, but it is not null", `"obj`"), msg) \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_null +// Macro: uvmkit_assert_not_null // // Asserts that an object handle is not null. // Fails if the handle is null, indicating that an expected object was not @@ -254,13 +254,13 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_not_null(driver, "Driver must be created") -// | `uvmkit_check_not_null(cfg, "Configuration object required") -// | `uvmkit_check_not_null(get_object(), "Factory must return valid object") +// | `uvmkit_assert_not_null(driver, "Driver must be created") +// | `uvmkit_assert_not_null(cfg, "Configuration object required") +// | `uvmkit_assert_not_null(get_object(), "Factory must return valid object") // -`define uvmkit_check_not_null(obj, msg="") \ +`define uvmkit_assert_not_null(obj, msg="") \ if ((obj) == null) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_null", $sformatf("Expected '%s' to not be null, but it is null", `"obj`"), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_null", $sformatf("Expected '%s' to not be null, but it is null", `"obj`"), msg) \ end //------------------------------------------------------------------------------ @@ -271,7 +271,7 @@ // their contents are equal. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_same +// Macro: uvmkit_assert_same // // Asserts that two object handles refer to the same object instance. // This performs handle comparison, not content comparison. @@ -283,16 +283,16 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_same(cached_obj, retrieved_obj, "Should retrieve cached instance") -// | `uvmkit_check_same(singleton_a, singleton_b, "Singleton pattern violated") +// | `uvmkit_assert_same(cached_obj, retrieved_obj, "Should retrieve cached instance") +// | `uvmkit_assert_same(singleton_a, singleton_b, "Singleton pattern violated") // -`define uvmkit_check_same(a, b, msg="") \ +`define uvmkit_assert_same(a, b, msg="") \ if ((a) != (b)) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_same", $sformatf("Expected '%s' and '%s' to be the same object, but they are different", `"a`", `"b`"), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_same", $sformatf("Expected '%s' and '%s' to be the same object, but they are different", `"a`", `"b`"), msg) \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_same +// Macro: uvmkit_assert_not_same // // Asserts that two object handles refer to different object instances. // This performs handle comparison, not content comparison. @@ -304,12 +304,12 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_not_same(obj_a, obj_b, "Objects should be independent copies") -// | `uvmkit_check_not_same(cloned, original, "Clone must be a new instance") +// | `uvmkit_assert_not_same(obj_a, obj_b, "Objects should be independent copies") +// | `uvmkit_assert_not_same(cloned, original, "Clone must be a new instance") // -`define uvmkit_check_not_same(a, b, msg="") \ +`define uvmkit_assert_not_same(a, b, msg="") \ if ((a) == (b)) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_same", $sformatf("Expected '%s' and '%s' to be different objects, but they are the same", `"a`", `"b`"), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_same", $sformatf("Expected '%s' and '%s' to be different objects, but they are the same", `"a`", `"b`"), msg) \ end //------------------------------------------------------------------------------ @@ -320,7 +320,7 @@ // appropriate. These macros compare values within a specified delta. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_equals_real +// Macro: uvmkit_assert_equals_real // // Asserts that two real values are equal within a specified tolerance. // The assertion passes if the absolute difference between the values @@ -333,11 +333,11 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_equals_real(3.14159, pi_approx, 0.0001, "Pi approximation") -// | `uvmkit_check_equals_real(expected_voltage, measured, 0.05, "Voltage within 50mV") -// | `uvmkit_check_equals_real(1.0, result, 1e-6, "Result should be close to 1.0") +// | `uvmkit_assert_equals_real(3.14159, pi_approx, 0.0001, "Pi approximation") +// | `uvmkit_assert_equals_real(expected_voltage, measured, 0.05, "Voltage within 50mV") +// | `uvmkit_assert_equals_real(1.0, result, 1e-6, "Result should be close to 1.0") // -`define uvmkit_check_equals_real(expected, actual, delta, msg="") \ +`define uvmkit_assert_equals_real(expected, actual, delta, msg="") \ begin \ real _expected_val; \ real _actual_val; \ @@ -348,12 +348,12 @@ _delta_val = (delta); \ _abs_diff = (_expected_val > _actual_val) ? (_expected_val - _actual_val) : (_actual_val - _expected_val); \ if (_abs_diff > _delta_val) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_equals_real", $sformatf("Expected '%s' and '%s' to be equal within delta %0g, but |%0g - %0g| = %0g", `"expected`", `"actual`", _delta_val, _expected_val, _actual_val, _abs_diff), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_equals_real", $sformatf("Expected '%s' and '%s' to be equal within delta %0g, but |%0g - %0g| = %0g", `"expected`", `"actual`", _delta_val, _expected_val, _actual_val, _abs_diff), msg) \ end \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_equals_real +// Macro: uvmkit_assert_not_equals_real // // Asserts that two real values are not equal within a specified tolerance. // The assertion passes if the absolute difference between the values @@ -366,10 +366,10 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_not_equals_real(0.0, signal_level, 0.1, "Signal should be non-zero") -// | `uvmkit_check_not_equals_real(old_temp, new_temp, 1.0, "Temperature should change") +// | `uvmkit_assert_not_equals_real(0.0, signal_level, 0.1, "Signal should be non-zero") +// | `uvmkit_assert_not_equals_real(old_temp, new_temp, 1.0, "Temperature should change") // -`define uvmkit_check_not_equals_real(expected, actual, delta, msg="") \ +`define uvmkit_assert_not_equals_real(expected, actual, delta, msg="") \ begin \ real _expected_val; \ real _actual_val; \ @@ -380,7 +380,7 @@ _delta_val = (delta); \ _abs_diff = (_expected_val > _actual_val) ? (_expected_val - _actual_val) : (_actual_val - _expected_val); \ if (_abs_diff <= _delta_val) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_equals_real", $sformatf("Expected '%s' and '%s' to not be equal within delta %0g, but |%0g - %0g| = %0g", `"expected`", `"actual`", _delta_val, _expected_val, _actual_val, _abs_diff), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_equals_real", $sformatf("Expected '%s' and '%s' to not be equal within delta %0g, but |%0g - %0g| = %0g", `"expected`", `"actual`", _delta_val, _expected_val, _actual_val, _abs_diff), msg) \ end \ end @@ -391,7 +391,7 @@ // These macros provide clear error messages using enum names. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_equals_enum +// Macro: uvmkit_assert_equals_enum // // Asserts that two enum values are equal. // Error messages include the enum names for easy debugging. @@ -405,22 +405,22 @@ // Example: // | typedef enum {IDLE, ACTIVE, ERROR} state_t; // | state_t current_state; -// | `uvmkit_check_equals_enum(state_t, IDLE, current_state, "Should be in IDLE") -// | `uvmkit_check_equals_enum(opcode_t, ADD, decoded_op, "Opcode mismatch") +// | `uvmkit_assert_equals_enum(state_t, IDLE, current_state, "Should be in IDLE") +// | `uvmkit_assert_equals_enum(opcode_t, ADD, decoded_op, "Opcode mismatch") // -`define uvmkit_check_equals_enum(enum_t, expected, actual, msg="") \ +`define uvmkit_assert_equals_enum(enum_t, expected, actual, msg="") \ begin \ enum_t _expected; \ enum_t _actual; \ _expected = expected; \ _actual = actual; \ if (_expected !== _actual) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_equals_enum", $sformatf("Expected '%s' to equal '%s', but %s !== %s", `"expected`", `"actual`", _expected.name(), _actual.name()), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_equals_enum", $sformatf("Expected '%s' to equal '%s', but %s !== %s", `"expected`", `"actual`", _expected.name(), _actual.name()), msg) \ end \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_equals_enum +// Macro: uvmkit_assert_not_equals_enum // // Asserts that two enum values are not equal. // Error messages include the enum names for easy debugging. @@ -432,17 +432,17 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_not_equals_enum(state_t, ERROR, current_state, "Should not be ERROR") -// | `uvmkit_check_not_equals_enum(priority_t, old_prio, new_prio, "Priority should change") +// | `uvmkit_assert_not_equals_enum(state_t, ERROR, current_state, "Should not be ERROR") +// | `uvmkit_assert_not_equals_enum(priority_t, old_prio, new_prio, "Priority should change") // -`define uvmkit_check_not_equals_enum(enum_t, expected, actual, msg="") \ +`define uvmkit_assert_not_equals_enum(enum_t, expected, actual, msg="") \ begin \ enum_t _expected; \ enum_t _actual; \ _expected = expected; \ _actual = actual; \ if (_expected === _actual) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_equals_enum", $sformatf("Expected '%s' to not equal '%s', but both are %s", `"expected`", `"actual`", _expected.name()), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_equals_enum", $sformatf("Expected '%s' to not equal '%s', but both are %s", `"expected`", `"actual`", _expected.name()), msg) \ end \ end @@ -453,7 +453,7 @@ // These macros work with all simulators including Verilator. //------------------------------------------------------------------------------ -// Macro: uvmkit_check_equals_string +// Macro: uvmkit_assert_equals_string // // Asserts that two strings are equal. // The comparison is case-sensitive and checks for exact match. @@ -465,11 +465,11 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_equals_string("IDLE", state_name, "State name mismatch") -// | `uvmkit_check_equals_string(expected_msg, received_msg, "Message content wrong") -// | `uvmkit_check_equals_string(get_name(), "my_component", "Name mismatch") +// | `uvmkit_assert_equals_string("IDLE", state_name, "State name mismatch") +// | `uvmkit_assert_equals_string(expected_msg, received_msg, "Message content wrong") +// | `uvmkit_assert_equals_string(get_name(), "my_component", "Name mismatch") // -`define uvmkit_check_equals_string(a, b, msg="") \ +`define uvmkit_assert_equals_string(a, b, msg="") \ begin \ string _a_str; \ string _b_str; \ @@ -478,12 +478,12 @@ _b_str = (b); \ _exp_result = _a_str == _b_str; \ if (_exp_result !== 1'b1) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_equals_string", $sformatf("Expected strings to be equal:\n Expected: \"%s\"\n Actual: \"%s\"", _a_str, _b_str), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_equals_string", $sformatf("Expected strings to be equal:\n Expected: \"%s\"\n Actual: \"%s\"", _a_str, _b_str), msg) \ end \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_equals_string +// Macro: uvmkit_assert_not_equals_string // // Asserts that two strings are not equal. // The comparison is case-sensitive. @@ -495,10 +495,10 @@ // msg - Optional message providing context for the assertion (default: "") // // Example: -// | `uvmkit_check_not_equals_string(prev_name, new_name, "Name should have changed") -// | `uvmkit_check_not_equals_string("", description, "Description cannot be empty") +// | `uvmkit_assert_not_equals_string(prev_name, new_name, "Name should have changed") +// | `uvmkit_assert_not_equals_string("", description, "Description cannot be empty") // -`define uvmkit_check_not_equals_string(a, b, msg="") \ +`define uvmkit_assert_not_equals_string(a, b, msg="") \ begin \ string _a_str; \ string _b_str; \ @@ -507,7 +507,7 @@ _b_str = (b); \ _exp_result = _a_str != _b_str; \ if (_exp_result !== 1'b1) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_equals_string", $sformatf("Expected strings to be different, but both are:\n \"%s\"", _a_str), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_equals_string", $sformatf("Expected strings to be different, but both are:\n \"%s\"", _a_str), msg) \ end \ end @@ -516,12 +516,12 @@ //------------------------------------------------------------------------------ // Assertions for comparing UVM objects using their compare() method. // These macros are only available when UVM is defined (by including uvm_macros.svh). -// This conditional compilation allows uvmkit_check to be used in non-UVM environments. +// This conditional compilation allows uvmkit_assert to be used in non-UVM environments. `ifdef uvm_error //------------------------------------------------------------------------------ -// Macro: uvmkit_check_equals_uvm +// Macro: uvmkit_assert_equals_uvm // // Asserts that two UVM objects are equal using their compare() method. // This performs a deep comparison of object contents based on the @@ -537,28 +537,28 @@ // // Example: // | my_transaction expected_txn, actual_txn; -// | `uvmkit_check_equals_uvm(expected_txn, actual_txn, "Transaction mismatch") +// | `uvmkit_assert_equals_uvm(expected_txn, actual_txn, "Transaction mismatch") // | // | uvm_reg expected_reg, actual_reg; -// | `uvmkit_check_equals_uvm(expected_reg, actual_reg, "Register config differs") +// | `uvmkit_assert_equals_uvm(expected_reg, actual_reg, "Register config differs") // -`define uvmkit_check_equals_uvm(a, b, msg="") \ +`define uvmkit_assert_equals_uvm(a, b, msg="") \ begin \ automatic uvm_object _a_obj = a; \ automatic uvm_object _b_obj = b; \ bit _compare_result; \ if (_a_obj == null || _b_obj == null) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_equals_uvm", "Cannot compare null objects", msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_equals_uvm", "Cannot compare null objects", msg) \ end else begin \ _compare_result = _a_obj.compare(_b_obj); \ if (!_compare_result) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_equals_uvm", $sformatf("UVM objects do not match:\n Type: %s vs %s", _a_obj.get_type_name(), _b_obj.get_type_name()), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_equals_uvm", $sformatf("UVM objects do not match:\n Type: %s vs %s", _a_obj.get_type_name(), _b_obj.get_type_name()), msg) \ end \ end \ end //------------------------------------------------------------------------------ -// Macro: uvmkit_check_not_equals_uvm +// Macro: uvmkit_assert_not_equals_uvm // // Asserts that two UVM objects are not equal using their compare() method. // This performs a deep comparison of object contents based on the @@ -574,12 +574,12 @@ // // Example: // | my_transaction prev_txn, new_txn; -// | `uvmkit_check_not_equals_uvm(prev_txn, new_txn, "Transactions should differ") +// | `uvmkit_assert_not_equals_uvm(prev_txn, new_txn, "Transactions should differ") // | // | uvm_sequence_item item_a, item_b; -// | `uvmkit_check_not_equals_uvm(item_a, item_b, "Items must be unique") +// | `uvmkit_assert_not_equals_uvm(item_a, item_b, "Items must be unique") // -`define uvmkit_check_not_equals_uvm(a, b, msg="") \ +`define uvmkit_assert_not_equals_uvm(a, b, msg="") \ begin \ automatic uvm_object _a_obj = a; \ automatic uvm_object _b_obj = b; \ @@ -587,13 +587,13 @@ if (_a_obj == null || _b_obj == null) begin \ // If one or both are null, they are different (unless both are null) \ if (_a_obj == null && _b_obj == null) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_equals_uvm", "Both objects are null, so they are equal", msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_equals_uvm", "Both objects are null, so they are equal", msg) \ end \ // else: one is null and one is not, so they are different - pass \ end else begin \ _compare_result = _a_obj.compare(_b_obj); \ if (_compare_result) begin \ - `uvmkit_error_msg_fmt("uvmkit_check_not_equals_uvm", $sformatf("UVM objects match, but expected them to be different:\n Type: %s", _a_obj.get_type_name()), msg) \ + `uvmkit_error_msg_fmt("uvmkit_assert_not_equals_uvm", $sformatf("UVM objects match, but expected them to be different:\n Type: %s", _a_obj.get_type_name()), msg) \ end \ end \ end @@ -603,7 +603,7 @@ //------------------------------------------------------------------------------ // Notes and Future Enhancements //------------------------------------------------------------------------------ -// TODOs pertaining to uvmkit_check_equals and uvmkit_check_not_equals: +// TODOs pertaining to uvmkit_assert_equals and uvmkit_assert_not_equals: // - If both inputs are X but their sizes differ, they are not equal. This is // correct, but hard to debug. Consider adding size information to error messages. // - Consider adding format options (decimal, hex, binary) for expression output. diff --git a/tests/unit/uvmkit_check_unit_test.sv b/tests/unit/uvmkit_assert_unit_test.sv similarity index 74% rename from tests/unit/uvmkit_check_unit_test.sv rename to tests/unit/uvmkit_assert_unit_test.sv index 0f8e423..ac5c534 100644 --- a/tests/unit/uvmkit_check_unit_test.sv +++ b/tests/unit/uvmkit_assert_unit_test.sv @@ -1,9 +1,9 @@ `include "svunit_defines.svh" -module uvmkit_check_unit_test; +module uvmkit_assert_unit_test; import svunit_pkg::svunit_testcase; - string name = "uvmkit_check_ut"; + string name = "uvmkit_assert_ut"; svunit_testcase svunit_ut; // @@ -29,7 +29,7 @@ module uvmkit_check_unit_test; string last_msg; `define uvmkit_error_msg(typ, msg) error_called = 1; last_msg = msg; `define uvm_error - `include "uvmkit_check.sv" + `include "uvmkit_assert.sv" `include "packet.sv" //=================================== @@ -83,143 +83,143 @@ module uvmkit_check_unit_test; `SVUNIT_TESTS_BEGIN `SVTEST(fail_called) - `uvmkit_check_fail() + `uvmkit_assert_fail() `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(true_test) - `uvmkit_check_true(1) + `uvmkit_assert_true(1) `FAIL_IF(error_called) - `uvmkit_check_true(0) + `uvmkit_assert_true(0) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(true_x_test_1) - `uvmkit_check_true(1'bx) + `uvmkit_assert_true(1'bx) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(true_x_test_2) - `uvmkit_check_true(32'bx) + `uvmkit_assert_true(32'bx) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(additional_error_message) bit ok; - `uvmkit_check_true(0, "This may be due to argument passed to check") + `uvmkit_assert_true(0, "This may be due to argument passed to check") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "argument passed to check"); `FAIL_UNLESS(ok) `SVTEST_END `SVTEST(true_z_test) - `uvmkit_check_true(1'bz) + `uvmkit_assert_true(1'bz) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(false_test) - `uvmkit_check_false(0) + `uvmkit_assert_false(0) `FAIL_IF(error_called) - `uvmkit_check_false(1) + `uvmkit_assert_false(1) `FAIL_UNLESS(error_called) `SVTEST_END // 2-state simulators convert x and z to 0, making these tests invalid `ifndef VERILATOR `SVTEST(false_x_test_1) - `uvmkit_check_false(1'bx) + `uvmkit_assert_false(1'bx) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(false_z_test) - `uvmkit_check_false(1'bz) + `uvmkit_assert_false(1'bz) `FAIL_UNLESS(error_called) `SVTEST_END `endif `SVTEST(equals_basic_test) - `uvmkit_check_equals(1, 1) + `uvmkit_assert_equals(1, 1) `FAIL_IF(error_called) - `uvmkit_check_equals(0, 0) + `uvmkit_assert_equals(0, 0) `FAIL_IF(error_called) - `uvmkit_check_equals(1, 0) + `uvmkit_assert_equals(1, 0) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(equals_different_widths) - `uvmkit_check_equals(8'h5A, 8'h5A) + `uvmkit_assert_equals(8'h5A, 8'h5A) `FAIL_IF(error_called) - `uvmkit_check_equals(4'b1010, 4'b1010) + `uvmkit_assert_equals(4'b1010, 4'b1010) `FAIL_IF(error_called) - `uvmkit_check_equals(8'hFF, 4'hF) + `uvmkit_assert_equals(8'hFF, 4'hF) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(equals_x_values) - `uvmkit_check_equals(1'bx, 1'bx) + `uvmkit_assert_equals(1'bx, 1'bx) `FAIL_IF(error_called) - `uvmkit_check_equals(8'bx, 8'bx) + `uvmkit_assert_equals(8'bx, 8'bx) `FAIL_IF(error_called) - `uvmkit_check_equals(1'bx, 1'b0) + `uvmkit_assert_equals(1'bx, 1'b0) `FAIL_UNLESS(error_called) error_called = 0; - `uvmkit_check_equals(8'hx5, 8'h05) + `uvmkit_assert_equals(8'hx5, 8'h05) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(equals_z_values) - `uvmkit_check_equals(1'bz, 1'bz) + `uvmkit_assert_equals(1'bz, 1'bz) `FAIL_IF(error_called) - `uvmkit_check_equals(1'bz, 1'b0) + `uvmkit_assert_equals(1'bz, 1'b0) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(equals_with_message) bit ok; - `uvmkit_check_equals(1, 0, "Values should be equal") + `uvmkit_assert_equals(1, 0, "Values should be equal") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Values should be equal"); `FAIL_UNLESS(ok) `SVTEST_END `SVTEST(not_equals_basic_test) - `uvmkit_check_not_equals(1, 0) + `uvmkit_assert_not_equals(1, 0) `FAIL_IF(error_called) - `uvmkit_check_not_equals(0, 1) + `uvmkit_assert_not_equals(0, 1) `FAIL_IF(error_called) - `uvmkit_check_not_equals(1, 1) + `uvmkit_assert_not_equals(1, 1) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(not_equals_different_widths) - `uvmkit_check_not_equals(8'hAA, 8'h55) + `uvmkit_assert_not_equals(8'hAA, 8'h55) `FAIL_IF(error_called) - `uvmkit_check_not_equals(8'hFF, 4'hA) + `uvmkit_assert_not_equals(8'hFF, 4'hA) `FAIL_IF(error_called) - `uvmkit_check_not_equals(4'hF, 4'hF) + `uvmkit_assert_not_equals(4'hF, 4'hF) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(not_equals_x_values) - `uvmkit_check_not_equals(1'bx, 1'b0) + `uvmkit_assert_not_equals(1'bx, 1'b0) `FAIL_IF(error_called) - `uvmkit_check_not_equals(8'hxA, 8'h0A) + `uvmkit_assert_not_equals(8'hxA, 8'h0A) `FAIL_IF(error_called) - `uvmkit_check_not_equals(1'bx, 1'bx) + `uvmkit_assert_not_equals(1'bx, 1'bx) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(not_equals_z_values) - `uvmkit_check_not_equals(1'bz, 1'b0) + `uvmkit_assert_not_equals(1'bz, 1'b0) `FAIL_IF(error_called) - `uvmkit_check_not_equals(1'bz, 1'bz) + `uvmkit_assert_not_equals(1'bz, 1'bz) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(not_equals_with_message) bit ok; - `uvmkit_check_not_equals(5, 5, "Values should not be equal") + `uvmkit_assert_not_equals(5, 5, "Values should not be equal") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Values should not be equal"); `FAIL_UNLESS(ok) @@ -228,17 +228,17 @@ module uvmkit_check_unit_test; `SVTEST(null_basic_test) string s; s = null; - `uvmkit_check_null(s) + `uvmkit_assert_null(s) `FAIL_IF(error_called) s = "not null"; - `uvmkit_check_null(s) + `uvmkit_assert_null(s) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(null_with_message) bit ok; string s = "not null"; - `uvmkit_check_null(s, "String should be null") + `uvmkit_assert_null(s, "String should be null") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "String should be null"); `FAIL_UNLESS(ok) @@ -246,17 +246,17 @@ module uvmkit_check_unit_test; `SVTEST(not_null_basic_test) string s = "not null"; - `uvmkit_check_not_null(s) + `uvmkit_assert_not_null(s) `FAIL_IF(error_called) s = null; - `uvmkit_check_not_null(s) + `uvmkit_assert_not_null(s) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(not_null_with_message) bit ok; string s = null; - `uvmkit_check_not_null(s, "String should not be null") + `uvmkit_assert_not_null(s, "String should not be null") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "String should not be null"); `FAIL_UNLESS(ok) @@ -266,10 +266,10 @@ module uvmkit_check_unit_test; // Test with a class object svunit_testcase obj; obj = null; - `uvmkit_check_null(obj) + `uvmkit_assert_null(obj) `FAIL_IF(error_called) obj = new("test"); - `uvmkit_check_null(obj) + `uvmkit_assert_null(obj) `FAIL_UNLESS(error_called) `SVTEST_END @@ -277,10 +277,10 @@ module uvmkit_check_unit_test; // Test with a class object svunit_testcase obj; obj = new("test"); - `uvmkit_check_not_null(obj) + `uvmkit_assert_not_null(obj) `FAIL_IF(error_called) obj = null; - `uvmkit_check_not_null(obj) + `uvmkit_assert_not_null(obj) `FAIL_UNLESS(error_called) `SVTEST_END @@ -289,10 +289,10 @@ module uvmkit_check_unit_test; svunit_testcase obj1, obj2; obj1 = new("test1"); obj2 = obj1; // Same object - `uvmkit_check_same(obj1, obj2) + `uvmkit_assert_same(obj1, obj2) `FAIL_IF(error_called) obj2 = new("test2"); // Different object - `uvmkit_check_same(obj1, obj2) + `uvmkit_assert_same(obj1, obj2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -301,10 +301,10 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "hello"; s2 = s1; // Same reference - `uvmkit_check_same(s1, s2) + `uvmkit_assert_same(s1, s2) `FAIL_IF(error_called) s2 = "world"; // Different string - `uvmkit_check_same(s1, s2) + `uvmkit_assert_same(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -313,10 +313,10 @@ module uvmkit_check_unit_test; svunit_testcase obj1, obj2; obj1 = null; obj2 = null; - `uvmkit_check_same(obj1, obj2) + `uvmkit_assert_same(obj1, obj2) `FAIL_IF(error_called) obj1 = new("test"); - `uvmkit_check_same(obj1, obj2) + `uvmkit_assert_same(obj1, obj2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -325,7 +325,7 @@ module uvmkit_check_unit_test; svunit_testcase obj1, obj2; obj1 = new("test1"); obj2 = new("test2"); - `uvmkit_check_same(obj1, obj2, "Objects should be the same") + `uvmkit_assert_same(obj1, obj2, "Objects should be the same") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Objects should be the same"); `FAIL_UNLESS(ok) @@ -336,10 +336,10 @@ module uvmkit_check_unit_test; svunit_testcase obj1, obj2; obj1 = new("test1"); obj2 = new("test2"); // Different objects - `uvmkit_check_not_same(obj1, obj2) + `uvmkit_assert_not_same(obj1, obj2) `FAIL_IF(error_called) obj2 = obj1; // Same object - `uvmkit_check_not_same(obj1, obj2) + `uvmkit_assert_not_same(obj1, obj2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -348,10 +348,10 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "hello"; s2 = "world"; // Different strings - `uvmkit_check_not_same(s1, s2) + `uvmkit_assert_not_same(s1, s2) `FAIL_IF(error_called) s2 = s1; // Same reference - `uvmkit_check_not_same(s1, s2) + `uvmkit_assert_not_same(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -360,10 +360,10 @@ module uvmkit_check_unit_test; svunit_testcase obj1, obj2; obj1 = new("test"); obj2 = null; - `uvmkit_check_not_same(obj1, obj2) + `uvmkit_assert_not_same(obj1, obj2) `FAIL_IF(error_called) obj1 = null; - `uvmkit_check_not_same(obj1, obj2) + `uvmkit_assert_not_same(obj1, obj2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -372,7 +372,7 @@ module uvmkit_check_unit_test; svunit_testcase obj1, obj2; obj1 = new("test"); obj2 = obj1; - `uvmkit_check_not_same(obj1, obj2, "Objects should be different") + `uvmkit_assert_not_same(obj1, obj2, "Objects should be different") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Objects should be different"); `FAIL_UNLESS(ok) @@ -382,15 +382,15 @@ module uvmkit_check_unit_test; real a, b; a = 1.0; b = 1.0; - `uvmkit_check_equals_real(a, b, 0.001) + `uvmkit_assert_equals_real(a, b, 0.001) `FAIL_IF(error_called) a = 1.0; b = 1.001; - `uvmkit_check_equals_real(a, b, 0.002) + `uvmkit_assert_equals_real(a, b, 0.002) `FAIL_IF(error_called) a = 1.0; b = 1.5; - `uvmkit_check_equals_real(a, b, 0.1) + `uvmkit_assert_equals_real(a, b, 0.1) `FAIL_UNLESS(error_called) `SVTEST_END @@ -398,7 +398,7 @@ module uvmkit_check_unit_test; real a, b; a = 3.14159; b = 3.14159; - `uvmkit_check_equals_real(a, b, 0.0) + `uvmkit_assert_equals_real(a, b, 0.0) `FAIL_IF(error_called) `SVTEST_END @@ -407,13 +407,13 @@ module uvmkit_check_unit_test; // Test at exact boundary - should pass a = 1.0; b = 1.001; - `uvmkit_check_equals_real(a, b, 0.001) + `uvmkit_assert_equals_real(a, b, 0.001) `FAIL_IF(error_called) // Test just over boundary - should fail error_called = 0; a = 1.0; b = 1.0011; - `uvmkit_check_equals_real(a, b, 0.001) + `uvmkit_assert_equals_real(a, b, 0.001) `FAIL_UNLESS(error_called) `SVTEST_END @@ -421,11 +421,11 @@ module uvmkit_check_unit_test; real a, b; a = -5.5; b = -5.51; - `uvmkit_check_equals_real(a, b, 0.02) + `uvmkit_assert_equals_real(a, b, 0.02) `FAIL_IF(error_called) a = -5.5; b = -5.6; - `uvmkit_check_equals_real(a, b, 0.05) + `uvmkit_assert_equals_real(a, b, 0.05) `FAIL_UNLESS(error_called) `SVTEST_END @@ -433,10 +433,10 @@ module uvmkit_check_unit_test; real a, b; a = 1.0; b = -1.0; - `uvmkit_check_equals_real(a, b, 3.0) + `uvmkit_assert_equals_real(a, b, 3.0) `FAIL_IF(error_called) error_called = 0; - `uvmkit_check_equals_real(a, b, 1.0) + `uvmkit_assert_equals_real(a, b, 1.0) `FAIL_UNLESS(error_called) `SVTEST_END @@ -445,7 +445,7 @@ module uvmkit_check_unit_test; real a, b; a = 1.0; b = 2.0; - `uvmkit_check_equals_real(a, b, 0.5, "Real values should be close") + `uvmkit_assert_equals_real(a, b, 0.5, "Real values should be close") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Real values should be close"); `FAIL_UNLESS(ok) @@ -455,10 +455,10 @@ module uvmkit_check_unit_test; real a, b; a = 0.0001; b = 0.0002; - `uvmkit_check_equals_real(a, b, 0.0001) + `uvmkit_assert_equals_real(a, b, 0.0001) `FAIL_IF(error_called) error_called = 0; - `uvmkit_check_equals_real(a, b, 0.00005) + `uvmkit_assert_equals_real(a, b, 0.00005) `FAIL_UNLESS(error_called) `SVTEST_END @@ -466,15 +466,15 @@ module uvmkit_check_unit_test; real a, b; a = 1.0; b = 2.0; - `uvmkit_check_not_equals_real(a, b, 0.5) + `uvmkit_assert_not_equals_real(a, b, 0.5) `FAIL_IF(error_called) a = 1.0; b = 1.5; - `uvmkit_check_not_equals_real(a, b, 0.1) + `uvmkit_assert_not_equals_real(a, b, 0.1) `FAIL_IF(error_called) a = 1.0; b = 1.001; - `uvmkit_check_not_equals_real(a, b, 0.002) + `uvmkit_assert_not_equals_real(a, b, 0.002) `FAIL_UNLESS(error_called) `SVTEST_END @@ -482,7 +482,7 @@ module uvmkit_check_unit_test; real a, b; a = 3.14159; b = 3.14159; - `uvmkit_check_not_equals_real(a, b, 0.0) + `uvmkit_assert_not_equals_real(a, b, 0.0) `FAIL_UNLESS(error_called) `SVTEST_END @@ -491,13 +491,13 @@ module uvmkit_check_unit_test; // Test just over boundary - should pass a = 1.0; b = 1.0011; - `uvmkit_check_not_equals_real(a, b, 0.001) + `uvmkit_assert_not_equals_real(a, b, 0.001) `FAIL_IF(error_called) // Test at exact boundary - should fail error_called = 0; a = 1.0; b = 1.001; - `uvmkit_check_not_equals_real(a, b, 0.001) + `uvmkit_assert_not_equals_real(a, b, 0.001) `FAIL_UNLESS(error_called) `SVTEST_END @@ -505,12 +505,12 @@ module uvmkit_check_unit_test; real a, b; a = -5.5; b = -5.6; - `uvmkit_check_not_equals_real(a, b, 0.05) + `uvmkit_assert_not_equals_real(a, b, 0.05) `FAIL_IF(error_called) error_called = 0; a = -5.5; b = -5.51; - `uvmkit_check_not_equals_real(a, b, 0.02) + `uvmkit_assert_not_equals_real(a, b, 0.02) `FAIL_UNLESS(error_called) `SVTEST_END @@ -518,10 +518,10 @@ module uvmkit_check_unit_test; real a, b; a = 1.0; b = -1.0; - `uvmkit_check_not_equals_real(a, b, 1.0) + `uvmkit_assert_not_equals_real(a, b, 1.0) `FAIL_IF(error_called) error_called = 0; - `uvmkit_check_not_equals_real(a, b, 3.0) + `uvmkit_assert_not_equals_real(a, b, 3.0) `FAIL_UNLESS(error_called) `SVTEST_END @@ -530,7 +530,7 @@ module uvmkit_check_unit_test; real a, b; a = 1.0; b = 1.0; - `uvmkit_check_not_equals_real(a, b, 0.5, "Real values should be different") + `uvmkit_assert_not_equals_real(a, b, 0.5, "Real values should be different") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Real values should be different"); `FAIL_UNLESS(ok) @@ -540,10 +540,10 @@ module uvmkit_check_unit_test; real a, b; a = 0.0001; b = 0.0002; - `uvmkit_check_not_equals_real(a, b, 0.00005) + `uvmkit_assert_not_equals_real(a, b, 0.00005) `FAIL_IF(error_called) error_called = 0; - `uvmkit_check_not_equals_real(a, b, 0.0001) + `uvmkit_assert_not_equals_real(a, b, 0.0001) `FAIL_UNLESS(error_called) `SVTEST_END @@ -551,21 +551,21 @@ module uvmkit_check_unit_test; color_e c1, c2; c1 = RED; c2 = RED; - `uvmkit_check_equals_enum(color_e, c1, c2) + `uvmkit_assert_equals_enum(color_e, c1, c2) `FAIL_IF(error_called) c1 = GREEN; c2 = BLUE; - `uvmkit_check_equals_enum(color_e, c1, c2) + `uvmkit_assert_equals_enum(color_e, c1, c2) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(equals_enum_with_constants) color_e c1; c1 = YELLOW; - `uvmkit_check_equals_enum(color_e, c1, YELLOW) + `uvmkit_assert_equals_enum(color_e, c1, YELLOW) `FAIL_IF(error_called) error_called = 0; - `uvmkit_check_equals_enum(color_e, c1, RED) + `uvmkit_assert_equals_enum(color_e, c1, RED) `FAIL_UNLESS(error_called) `SVTEST_END @@ -574,7 +574,7 @@ module uvmkit_check_unit_test; color_e c1, c2; c1 = RED; c2 = GREEN; - `uvmkit_check_equals_enum(color_e, c1, c2, "Colors should match") + `uvmkit_assert_equals_enum(color_e, c1, c2, "Colors should match") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Colors should match"); `FAIL_UNLESS(ok) @@ -584,21 +584,21 @@ module uvmkit_check_unit_test; color_e c1, c2; c1 = RED; c2 = GREEN; - `uvmkit_check_not_equals_enum(color_e, c1, c2) + `uvmkit_assert_not_equals_enum(color_e, c1, c2) `FAIL_IF(error_called) c1 = BLUE; c2 = BLUE; - `uvmkit_check_not_equals_enum(color_e, c1, c2) + `uvmkit_assert_not_equals_enum(color_e, c1, c2) `FAIL_UNLESS(error_called) `SVTEST_END `SVTEST(not_equals_enum_with_constants) color_e c1; c1 = YELLOW; - `uvmkit_check_not_equals_enum(color_e, c1, RED) + `uvmkit_assert_not_equals_enum(color_e, c1, RED) `FAIL_IF(error_called) error_called = 0; - `uvmkit_check_not_equals_enum(color_e, c1, YELLOW) + `uvmkit_assert_not_equals_enum(color_e, c1, YELLOW) `FAIL_UNLESS(error_called) `SVTEST_END @@ -607,7 +607,7 @@ module uvmkit_check_unit_test; color_e c1, c2; c1 = GREEN; c2 = GREEN; - `uvmkit_check_not_equals_enum(color_e, c1, c2, "Colors should be different") + `uvmkit_assert_not_equals_enum(color_e, c1, c2, "Colors should be different") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Colors should be different"); `FAIL_UNLESS(ok) @@ -617,11 +617,11 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "hello"; s2 = "hello"; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_IF(error_called) s1 = "world"; s2 = "hello"; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -629,11 +629,11 @@ module uvmkit_check_unit_test; string s1, s2; s1 = ""; s2 = ""; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_IF(error_called) s1 = ""; s2 = "not empty"; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -641,11 +641,11 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "hello world"; s2 = "hello world"; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_IF(error_called) s1 = "hello world"; s2 = "hello world"; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -653,7 +653,7 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "Hello"; s2 = "hello"; - `uvmkit_check_equals_string(s1, s2) + `uvmkit_assert_equals_string(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -662,7 +662,7 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "expected"; s2 = "actual"; - `uvmkit_check_equals_string(s1, s2, "Strings should match") + `uvmkit_assert_equals_string(s1, s2, "Strings should match") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Strings should match"); `FAIL_UNLESS(ok) @@ -672,11 +672,11 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "hello"; s2 = "world"; - `uvmkit_check_not_equals_string(s1, s2) + `uvmkit_assert_not_equals_string(s1, s2) `FAIL_IF(error_called) s1 = "same"; s2 = "same"; - `uvmkit_check_not_equals_string(s1, s2) + `uvmkit_assert_not_equals_string(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -684,11 +684,11 @@ module uvmkit_check_unit_test; string s1, s2; s1 = ""; s2 = "not empty"; - `uvmkit_check_not_equals_string(s1, s2) + `uvmkit_assert_not_equals_string(s1, s2) `FAIL_IF(error_called) s1 = ""; s2 = ""; - `uvmkit_check_not_equals_string(s1, s2) + `uvmkit_assert_not_equals_string(s1, s2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -696,7 +696,7 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "Hello"; s2 = "hello"; - `uvmkit_check_not_equals_string(s1, s2) + `uvmkit_assert_not_equals_string(s1, s2) `FAIL_IF(error_called) `SVTEST_END @@ -705,7 +705,7 @@ module uvmkit_check_unit_test; string s1, s2; s1 = "same"; s2 = "same"; - `uvmkit_check_not_equals_string(s1, s2, "Strings should be different") + `uvmkit_assert_not_equals_string(s1, s2, "Strings should be different") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Strings should be different"); `FAIL_UNLESS(ok) @@ -722,12 +722,12 @@ module uvmkit_check_unit_test; p2.addr = 32'h1234; p2.data = 64'hDEADBEEF; p2.id = 4'h5; - `uvmkit_check_equals_uvm(p1, p2) + `uvmkit_assert_equals_uvm(p1, p2) `FAIL_IF(error_called) // Different values should fail error_called = 0; p2.addr = 32'h5678; - `uvmkit_check_equals_uvm(p1, p2) + `uvmkit_assert_equals_uvm(p1, p2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -735,12 +735,12 @@ module uvmkit_check_unit_test; packet p1, p2; p1 = new("p1"); p2 = null; - `uvmkit_check_equals_uvm(p1, p2) + `uvmkit_assert_equals_uvm(p1, p2) `FAIL_UNLESS(error_called) error_called = 0; p1 = null; p2 = null; - `uvmkit_check_equals_uvm(p1, p2) + `uvmkit_assert_equals_uvm(p1, p2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -749,7 +749,7 @@ module uvmkit_check_unit_test; p1 = new("p1"); p1.addr = 32'h1234; p2 = p1; // Same object reference - `uvmkit_check_equals_uvm(p1, p2) + `uvmkit_assert_equals_uvm(p1, p2) `FAIL_IF(error_called) `SVTEST_END @@ -758,7 +758,7 @@ module uvmkit_check_unit_test; uvm_object obj; p1 = new("p1"); obj = new("obj"); - `uvmkit_check_equals_uvm(p1, obj) + `uvmkit_assert_equals_uvm(p1, obj) `FAIL_UNLESS(error_called) `SVTEST_END @@ -769,7 +769,7 @@ module uvmkit_check_unit_test; p2 = new("p2"); p1.addr = 32'h1234; p2.addr = 32'h5678; - `uvmkit_check_equals_uvm(p1, p2, "Packets should match") + `uvmkit_assert_equals_uvm(p1, p2, "Packets should match") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Packets should match"); `FAIL_UNLESS(ok) @@ -782,7 +782,7 @@ module uvmkit_check_unit_test; // Different values should pass p1.addr = 32'h1234; p2.addr = 32'h5678; - `uvmkit_check_not_equals_uvm(p1, p2) + `uvmkit_assert_not_equals_uvm(p1, p2) `FAIL_IF(error_called) // Same values should fail error_called = 0; @@ -791,7 +791,7 @@ module uvmkit_check_unit_test; p2.data = 64'hDEAD; p1.id = 4'h1; p2.id = 4'h1; - `uvmkit_check_not_equals_uvm(p1, p2) + `uvmkit_assert_not_equals_uvm(p1, p2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -799,7 +799,7 @@ module uvmkit_check_unit_test; packet p1, p2; p1 = new("p1"); p2 = null; - `uvmkit_check_not_equals_uvm(p1, p2) + `uvmkit_assert_not_equals_uvm(p1, p2) `FAIL_IF(error_called) `SVTEST_END @@ -807,7 +807,7 @@ module uvmkit_check_unit_test; packet p1, p2; p1 = null; p2 = null; - `uvmkit_check_not_equals_uvm(p1, p2) + `uvmkit_assert_not_equals_uvm(p1, p2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -816,7 +816,7 @@ module uvmkit_check_unit_test; p1 = new("p1"); p1.addr = 32'h1234; p2 = p1; // Same object reference - `uvmkit_check_not_equals_uvm(p1, p2) + `uvmkit_assert_not_equals_uvm(p1, p2) `FAIL_UNLESS(error_called) `SVTEST_END @@ -831,7 +831,7 @@ module uvmkit_check_unit_test; p2.addr = 32'h1234; p2.data = 64'hDEAD; p2.id = 4'h5; - `uvmkit_check_not_equals_uvm(p1, p2, "Packets should be different") + `uvmkit_assert_not_equals_uvm(p1, p2, "Packets should be different") `FAIL_UNLESS(error_called) ok = endswith(last_msg, "Packets should be different"); `FAIL_UNLESS(ok)