Fixed issue with SUBW in testbench

This commit is contained in:
Florian Zaruba 2017-04-09 13:37:15 +02:00
parent f681ced0d5
commit f69e1c42dc
2 changed files with 5 additions and 4 deletions

View file

@ -30,7 +30,7 @@ class alu_scoreboard extends uvm_scoreboard;
SUB:
result = seq_item.operand_a - seq_item.operand_b;
SUBW: begin
result = seq_item.operand_a[31:0] - seq_item.operand_b[31:0];
result32 = seq_item.operand_a[31:0] - seq_item.operand_b[31:0];
result = {{32{result32[31]}}, result32};
end
endcase

View file

@ -12,15 +12,16 @@ virtual class basic_sequence extends fu_if_seq;
fu_if_seq_item command;
command = fu_if_seq_item::type_id::create("command");
`uvm_info("ALU Sequence", $sformatf("Starting %s sequence", get_operator().name))
`uvm_info("ALU Sequence", $sformatf("Starting %s sequence", get_operator().name), UVM_LOW)
for(int i = 0; i <= 100; i++) begin
start_item(command);
if(~command.randomize())
`uvm_warning("ALU Basic Sequence", "Randomization constraints can not be met.")
void'(command.randomize());
command.operator = get_operator();
finish_item(command);
end
`uvm_info("ALU Sequence", $sformatf("Finished %s sequence", get_operator().name), UVM_LOW)
endtask : body
endclass : basic_sequence