`timescale 1ns/1ps //********************************************************* module Test_MQCAcell; //********************************************************* parameter reset=2'b00; parameter switch=2'b01; parameter hold=2'b10; wire[5:0] v [5:0]; reg [1:0] s [3:0]; wire in1,in2,in3; reg rin1,rin2,rin3; wire out1; // Instantiate the cells // input N, E, S, W; //QCAcell Q11(v(1,2), v(2,2), v(2,1), v(2,0), v(1,0), v(0,0),v(0,1),v(0,2), v(1,1),s(1,1)); /* N(in2) 0 1 2 3 4 5 0 X 1 X W(in1) 2 X X X X X X E 3 X 4 X 5 X S(in3) */ // N E S W MQCAcell Q02( nocell, v[2][1], nocell, in1, v[2][0], s[0]); //input 1 MQCAcell Q12( nocell, v[2][2], nocell, v[2][0], v[2][1], s[0]); //wire (input for maj) MQCAcell Q20( in2, nocell, v[1][2], nocell, v[0][2], s[0]); //input 2 MQCAcell Q21(v[0][2], nocell, v[2][2], nocell, v[1][2], s[0]); //wire (input for maj) MQCAcell Q25(v[4][2], nocell, in3, nocell, v[5][2], s[0]); //input 3 MQCAcell Q24(v[3][2], nocell, v[5][2], nocell, v[4][2], s[0]); //wire //MQCAcell Q24(v[3][2], nocell, in3, nocell, v[4][2], s[0]); //wire MQCAcell Q23(v[4][2], nocell, v[2][2], nocell, v[3][2], s[0]); //wire (input for Maj) MQCAcell Q22(v[1][2], v[2][3], v[3][2], v[2][1], v[2][2], s[0]); //maj MQCAcell Q32(nocell, v[2][4], nocell, v[2][2], v[2][3], s[0]); //wire MQCAcell Q42(nocell, v[2][5], nocell, v[2][3], v[2][4], s[0]); //wire MQCAcell Q52(nocell, out1, nocell, v[2][4], out1, s[0]); //output always #100 s[0] = (s[0] + 1) % 3; always #100 s[1] = (s[1] + 1) % 3; always #100 s[2] = (s[2] + 1) % 3; assign in1 = rin1; assign in2 = rin2; assign in3 = rin3; initial begin $dumpvars(0,Test_MQCAcell); //dice fino a che livello fare il dump dei segnali rin1 = 1'b0; // time = 0 rin2 = 1'b0; rin3 = 1'b0; s[2] =switch; s[1] =hold; s[0] =reset; rin1 <= #130 1'b1; rin2 <= #130 1'b1; rin3 <= #130 1'b1; rin3 = #300 1'b1; $finish; end endmodule