/////////////////////////////////////////////////////////////////////// // // cpu module // // this is simply a shell representing the pad_ring // which instances cpu_core // /////////////////////////////////////////////////////////////////////// module test(); timeunit 1ns; timeprecision 100ps; wire [15:0] Data_in; logic [15:0] Data_out; wire [15:0] Data; logic ENB, ME; logic [15:0] Data_mem_drive; // // Simulation of bidirectional pads // assign Data = (ENB == 0) ? ~(~Data_out) : 16'bz; assign Data_in = ~(~Data); assign Data = (ME == 1) ? Data_mem_drive : 16'bz; always begin Data_out = '0; #100 Data_out = '1; #100 Data_out = 'X; #100 Data_out = 'Z; #100 Data_out = '0; end always begin Data_mem_drive = '0; #50 Data_mem_drive = '1; #50 Data_mem_drive = '0; end always begin ENB = '0; ME = '0; #400 ENB = '1; ME = '0; #400 ME = '1; ENB = '1; #400 ENB = '1; end initial begin #1200 $stop; $finish; end initial begin #45 $display("%x %b%b %x %x", Data_out, ~ENB,ME, Data, Data_in); while (1) #50 $display("%x %b%b %x %x", Data_out, ~ENB,ME, Data, Data_in); end endmodule