on-internet
← Community

How can I use enum in a testbench while passing a file with vectors?

Stack Overflow ·

I declared a typedef enum in a package (in a file called Definition.sv): typedef enum logic[3:0] { AND = 4'b0000, //AND EOR = 4'b0001, //XOR SUB = 4'b0010, //Subtraction ADD = 4'b0100, //Sum ORR = 4'b1100, //OR MOV = 4'b1101, //Scrive un valore in un registro MVN = 4'b1111 //MoVe and Not } alu_op; typedef enum logic[1:0] { LSL = 2'b00, //Logical Shift Left LSR = 2'b01, //Logical Shift Right ASR = 2'b10, //Arithmetic Shift Right ROR = 2'b11 //Rotation Right } shift_op; Then I wrote the testbench: `timescale 1ns/1ps `include "Definition.sv" module ALU_TB (); /*Inputs*/ data_bus A, B; // data_bus

Comments

Sign in or sign up to comment and upvote.

No comments yet.