Hi all,
I have a question concerning the following three warnings:
** Warning: /home/zs/trunk/FPGA/Library/MemController/tb/MemController_PB.sv(101): (vlog-2240) Treating stand-alone use of function ‘randomize’ as an implicit VOID cast.
** Warning: /home/zs/trunk/FPGA/Library/MemController/tb/MemController_PB.sv(102): (vlog-2240) Treating stand-alone use of function ‘print_Address’ as an implicit VOID cast.
** Warning: /home/zs/trunk/FPGA/Library/MemController/tb/MemController_PB.sv(111): (vlog-2240) Treating stand-alone use of function ‘check_Content’ as an implicit VOID cast.
I don’t know exactly what I did wrong. For example I copied the code example for the randomize-call from the Doulos Golden Reference Guide.
I provide the source code for the class with the other two functions:
package MessageClasses;
class RAM_message_c;
rand bit[7:0] address;
function print_Address;
$display("RAM Address is %x", address);
endfunction
function check_Content(input logic[15:0] actualValue);
logic[7:0] highByte, lowByte;
logic [15:0] expectedValue;
lowByte = address;
highByte = address + 1;
expectedValue = {highByte, lowByte};
//$display("Expected value: %x", expectedValue);
//$display("Actual Value: %x", actualValue);
assert (expectedValue == actualValue)
else $error("Expected value and acutal value do not match");
endfunction
// only even addresses because of 16 bit access
constraint c_even {
address % 2 == 0;
}
endclass
endpackage
The functions are called in my MainProgram:
// reading the RAM
initial begin
for (int i = 0; i < 10; i++) begin
RAM_message[i] = new;
end
#20_000_000;
for (int i = 0; i < 10; i++) begin
RAM_message[i].randomize with { address inside {[0:10]}; };
RAM_message[i].print_Address;
@(posedge master_if.clk);
master_if.RAM_address = RAM_message[i].address;
master_if.RAM_enable = 'b1;
// RAM enable must be HIGH for 2 clock cycles => observation was made in Wave Window
@(posedge master_if.clk);
@(posedge master_if.clk);
master_if.RAM_enable = 'b0;
@(posedge master_if.clk);
RAM_message[i].check_Content(master_if.RAM_dataOut);
#5_000;
end
end
Thanks in advance for helping to get rid of these warnings!
Kind regards
Sebastian