0
module barrel(W,Y,S);
    input [3:0] W;
    input [1:0] S;
    output [3:0]Y;
    wire [3:0]T;

    assign {T,Y}={W,W}>>S;
endmodule
module sim();
    reg  [3:0] W;
    reg [1:0] S;
    wire [3:0] Y ;

    barrel sim1(W, S, Y);
    initial begin
            W = 4'b0100;
            S = 2'b01;
        #10 S = 2'b10;
        #10 S = 2'b11;
        #10 S = 2'b01;

        #10 W = 4'b0110;                
            S = 2'b01;
        #10 W = 4'b0111;
            S = 2'b01;
        #10 W = 4'b1101;
            S = 2'b01;          
    end

    
endmodule

These are the two files I am using to try and generate the wave from; however, the "no data" message keeps popping up when I try to simulate the sim.v file.

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43

1 Answers1

0

in the module :

module barrel(W,Y,S);

S is input , W is input, Y is output

but look at the test bench you wrote:

barrel sim1(W, S, Y);

S is reg , W is reg, Y is wire

but when calling the module, you wrote :

barrel sim1(W, S, Y);

it should be:

barrel sim1(W, Y, S);

what you did is that you are trying to modify output values (S) and expecting input values to change (Y)

abdo Salm
  • 1,678
  • 4
  • 12
  • 22