- Joined
- Sep 10, 2013
- Messages
- 7,945
- Helped
- 1,823
- Reputation
- 3,656
- Reaction score
- 1,809
- Trophy points
- 1,393
- Location
- USA
- Activity points
- 60,214
I still don't know how you can claim there wasn't a problem. What simulation tool are you using, because Xilinx ISE/Vivado and Modelsim all complained with the mixed case IndexX and the indexX declarations not being the same. What ever simulation tool you are using must have problems with adhering to the Verilog LRM.i changed my code to lower case , my problem is not with syntax error at all,
Why? I make typos all the time, and I've been writing Verilog/VHDL for decades.dear ads-ee you are right, i just mistyped it, i was embarrassed , that is why i told you it is not anything with syntax error
i did all of these and i traced X back to output of lookup module (combinational logic) but i couldn't find out why ? all output nets of lookup have some valid values before end up to nana gates " because i used NandGateLibrary" , and question is what could possibly goes wrong in nand gates ?? and if lookup module has problem then why it works correctly when i post synthesis simulate it alone ??
Oh, yeah. signal strength changes can hid these types of issues. One should never modify the default (hard) drive strength of VHDL/Verilog. You want to see X if multiple drivers are on the same signal driving to different values.
how can i prevent this signal strength changes ? i thought i should insert buffer in input of nand gates ?? but how can i do that ?
Code Verilog - [expand] 1 2 3 4 5 6 7 8 assign intermediate[7] = N165; assign intermediate[6] = N269; assign intermediate[5] = N377; assign intermediate[4] = N471; assign intermediate[3] = N564; assign intermediate[2] = N641; assign intermediate[1] = N714; assign intermediate[0] = N778;
Code Verilog - [expand] 1 2 3 4 5 6 7 8 assign intermediate[7] = 1'b0; assign intermediate[6] = 1'b0; assign intermediate[5] = 1'b0; assign intermediate[4] = 1'b0; assign intermediate[3] = 1'b0; assign intermediate[2] = 1'b0; assign intermediate[1] = 1'b0; assign intermediate[0] = 1'b0;
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 module lookup ( indexX, indexY, intermediate ); input [3:0] indexX; input [3:0] indexY; output [7:0] intermediate; wire n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20, n21, n22, n23, n24, n25, n26, n27, n28, n29, n30, n31, n32, n33, n34, n35, n36, n37, n38, n39, n40, n41, n42, n43, n44, n45, n46, n47, n48, n49, n50, n51, n52, n53, n54, n55, n56, n57, n58, ... NAND4_X2 U1 ( .A1(n86), .A2(n87), .A3(n88), .A4(n89), .ZN(intermediate[7]) ); NOR4_X2 U2 ( .A1(n90), .A2(n91), .A3(n92), .A4(n93), .ZN(n89) ); OAI222_X2 U4 ( .A1(n101), .A2(n102), .B1(n103), .B2(n104), .C1(n105), .C2( n106), .ZN(n91) ); AOI22_X2 U6 ( .A1(n2), .A2(n67), .B1(n71), .B2(n15), .ZN(n101) ); OAI221_X2 U7 ( .B1(n108), .B2(n109), .C1(n110), .C2(n111), .A(n112), .ZN(n90) ); OAI222_X2 U9 ( .A1(n114), .A2(n115), .B1(n85), .B2(n116), .C1(n117), .C2( n118), .ZN(n113) ); AOI221_X2 U10 ( .B1(n45), .B2(n36), .C1(n43), .C2(n52), .A(n119), .ZN(n110) ); NOR4_X2 U11 ( .A1(indexY[3]), .A2(indexX[1]), .A3(n65), .A4(n120), .ZN(n119) ); AOI221_X2 U13 ( .B1(n31), .B2(n65), .C1(n72), .C2(n11), .A(n121), .ZN(n88) ); ... NOR3_X2 U396 ( .A1(n99), .A2(indexY[1]), .A3(n100), .ZN(n92) ); NAND3_X2 U399 ( .A1(n100), .A2(n134), .A3(n349), .ZN(n346) ); NAND3_X2 U405 ( .A1(indexX[0]), .A2(indexX[2]), .A3(n63), .ZN(n349) ); NAND3_X2 U409 ( .A1(n42), .A2(n79), .A3(indexX[0]), .ZN(n134) ); NAND3_X2 U411 ( .A1(indexY[2]), .A2(n58), .A3(n80), .ZN(n145) ); NAND3_X2 U412 ( .A1(n427), .A2(n293), .A3(n428), .ZN(n419) ); OAI21_X2 U423 ( .B1(n393), .B2(n15), .A(n62), .ZN(n427) ); NOR2_X2 U426 ( .A1(indexX[3]), .A2(n105), .ZN(n350) ); NOR2_X2 U427 ( .A1(indexX[2]), .A2(n65), .ZN(n177) ); NAND3_X2 U429 ( .A1(n315), .A2(n316), .A3(n317), .ZN(n310) ); NAND3_X2 U431 ( .A1(indexY[1]), .A2(indexX[3]), .A3(n40), .ZN(n316) ); OAI21_X2 U432 ( .B1(n83), .B2(n72), .A(n2), .ZN(n315) ); INV_X4 U443 ( .A(indexX[0]), .ZN(n58) ); INV_X4 U444 ( .A(indexX[1]), .ZN(n49) ); INV_X4 U445 ( .A(indexY[2]), .ZN(n79) ); endmodule
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 module lookup ( indexX, indexY, intermediate ); input [3:0] indexX; input [3:0] indexY; output [7:0] intermediate; wire N165, N269, N377, N471, N564, N641, N714, N778, n442, n443, n444, n445, n446, n447, n448, n449, n450, n451, n452, n453, n454, n455, n456, n457, n458, n459, n460, n461, n462, n463, n464, n465, n466, n467, n468, n469, n470, n471, n472, n473, n474, n475, n476, n477, ... assign intermediate[7] = N165; assign intermediate[6] = N269; assign intermediate[5] = N377; assign intermediate[4] = N471; assign intermediate[3] = N564; assign intermediate[2] = N641; assign intermediate[1] = N714; assign intermediate[0] = N778; NAND4_X1 U450 ( .A1(n442), .A2(n443), .A3(n444), .A4(n445), .ZN(N778) ); NOR4_X1 U451 ( .A1(n446), .A2(n447), .A3(n448), .A4(n449), .ZN(n445) ); OAI33_X1 U452 ( .A1(n450), .A2(n451), .A3(n452), .B1(n453), .B2(n454), .B3( n455), .ZN(n449) ); NOR2_X1 U453 ( .A1(n456), .A2(n457), .ZN(n454) ); AOI21_X1 U454 ( .B1(n458), .B2(n459), .A(n460), .ZN(n448) ); OAI21_X1 U455 ( .B1(n461), .B2(n462), .A(n463), .ZN(n447) ); OAI21_X1 U456 ( .B1(n464), .B2(n465), .A(n466), .ZN(n463) ); INV_X1 U457 ( .A(n467), .ZN(n464) ); OAI221_X1 U458 ( .B1(n468), .B2(n469), .C1(n470), .C2(n471), .A(n472), .ZN( n446) ); AOI222_X1 U459 ( .A1(n473), .A2(n474), .B1(n475), .B2(n476), .C1(n477), .C2( n478), .ZN(n472) ); NOR3_X1 U460 ( .A1(n479), .A2(n480), .A3(n465), .ZN(n470) ); NOR3_X1 U461 ( .A1(n481), .A2(indexX[1]), .A3(n482), .ZN(n479) ); INV_X1 U462 ( .A(n483), .ZN(n468) ); AOI211_X1 U463 ( .C1(n480), .C2(n484), .A(n485), .B(n486), .ZN(n444) ); MUX2_X1 U464 ( .A(n487), .B(n488), .S(n489), .Z(n486) ); ... INV_X1 U904 ( .A(n481), .ZN(n476) ); NAND2_X1 U905 ( .A1(n637), .A2(n777), .ZN(n481) ); INV_X1 U906 ( .A(indexX[2]), .ZN(n777) ); INV_X1 U907 ( .A(indexX[3]), .ZN(n637) ); INV_X1 U908 ( .A(n860), .ZN(n582) ); NAND2_X1 U909 ( .A1(indexX[0]), .A2(n778), .ZN(n860) ); INV_X1 U910 ( .A(indexX[1]), .ZN(n778) ); endmodule
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 module lookup(indexX, indexY , clk ,out_port); input [3:0] indexX; input [3:0] indexY; input clk; output out_port; wire [7:0] temp; mem insMem(.IndexX(indexX),.indexY(indexY),.intemediate(temp)); regOut insRegOut(.inp(temp),.clk(clk),.out_port(out_port)); endmodule
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 module lookup ( indexX, indexY, intermediate ); input [3:0] indexX; input [3:0] indexY; output [7:0] intermediate; wire N165, N269, N377, N471, N564, N641, N714, N778, n442, n443, n444, n445, n446, n447, n448, n449, n450, n451, n452, n453, n454, n455, n456, n457, n458, n459, n460, n461, n462, n463, n464, n465, n466, n467, n468, n469, n470, n471, n472, n473, n474, n475, n476, n477, n478, n479, n480, n481, n482, n483, n484, n485, n486, n487, n488, ... assign intermediate[7] = N165; assign intermediate[6] = N269; assign intermediate[5] = N377; assign intermediate[4] = N471; assign intermediate[3] = N564; assign intermediate[2] = N641; assign intermediate[1] = N714; assign intermediate[0] = N778; NAND4_X1 U450 ( .A1(n442), .A2(n443), .A3(n444), .A4(n445), .ZN(N778) ); NOR4_X1 U451 ( .A1(n446), .A2(n447), .A3(n448), .A4(n449), .ZN(n445) ); OAI33_X1 U452 ( .A1(n450), .A2(n451), .A3(n452), .B1(n453), .B2(n454), .B3( n455), .ZN(n449) ); NOR2_X1 U453 ( .A1(n456), .A2(n457), .ZN(n454) ); AOI21_X1 U454 ( .B1(n458), .B2(n459), .A(n460), .ZN(n448) ); OAI21_X1 U455 ( .B1(n461), .B2(n462), .A(n463), .ZN(n447) ); OAI21_X1 U456 ( .B1(n464), .B2(n465), .A(n466), .ZN(n463) ); INV_X1 U457 ( .A(n467), .ZN(n464) ); OAI221_X1 U458 ( .B1(n468), .B2(n469), .C1(n470), .C2(n471), .A(n472), .ZN( n446) ); AOI222_X1 U459 ( .A1(n473), .A2(n474), .B1(n475), .B2(n476), .C1(n477), .C2( n478), .ZN(n472) ); NOR3_X1 U460 ( .A1(n479), .A2(n480), .A3(n465), .ZN(n470) ); NOR3_X1 U461 ( .A1(n481), .A2(indexX[1]), .A3(n482), .ZN(n479) ); INV_X1 U462 ( .A(n483), .ZN(n468) ); ... INV_X1 U898 ( .A(n701), .ZN(n456) ); NAND2_X1 U899 ( .A1(n655), .A2(n580), .ZN(n701) ); INV_X1 U900 ( .A(indexY[0]), .ZN(n580) ); INV_X1 U901 ( .A(indexY[2]), .ZN(n655) ); INV_X1 U902 ( .A(n693), .ZN(n699) ); NAND2_X1 U903 ( .A1(n582), .A2(n476), .ZN(n693) ); INV_X1 U904 ( .A(n481), .ZN(n476) ); NAND2_X1 U905 ( .A1(n637), .A2(n777), .ZN(n481) ); INV_X1 U906 ( .A(indexX[2]), .ZN(n777) ); INV_X1 U907 ( .A(indexX[3]), .ZN(n637) ); INV_X1 U908 ( .A(n860), .ZN(n582) ); NAND2_X1 U909 ( .A1(indexX[0]), .A2(n778), .ZN(n860) ); INV_X1 U910 ( .A(indexX[1]), .ZN(n778) ); endmodule
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 module lookup ( indexX, indexY, intermediate ); input [3:0] indexX; input [3:0] indexY; output [7:0] intermediate; wire N165, N269, N377, N471, N564, N641, N714, N778, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20, n21, n22, n23, n24, n25, n26, n27, n28, n29, n30, n31, n32, n33, n34, n35, n36, n37, n38, n39, n40, n41, n42, n43, n44, n45, n46, n47, n48, ... n381, n382, n383, n384, n385, n386, n387, n388, n389, n390, n391, n392, n393, n394, n395, n396, n397, n398, n399, n400, n401, n402, n403, n404, n405, n406, n407, n408, n409, n410, n411, n412, n413, n414, n415, n416, n417, n418, n419, n420, n421, n422, n423, n424, n425, n426, n427, n428, n429, n84, n86, n430, n431, n432; assign intermediate[7] = N165; assign intermediate[6] = N269; assign intermediate[5] = N377; assign intermediate[4] = N471; assign intermediate[3] = N564; assign intermediate[2] = N641; assign intermediate[1] = N714; assign intermediate[0] = N778; NAND4_X2 U1 ( .A1(n87), .A2(n88), .A3(n89), .A4(n90), .ZN(N778) ); NOR4_X2 U2 ( .A1(n91), .A2(n92), .A3(n93), .A4(n28), .ZN(n90) ); AOI221_X2 U7 ( .B1(n56), .B2(n108), .C1(n65), .C2(n109), .A(n110), .ZN(n89) ); OAI222_X2 U8 ( .A1(n111), .A2(n112), .B1(n113), .B2(n114), .C1(n115), .C2( n116), .ZN(n110) ); AOI22_X2 U9 ( .A1(n117), .A2(n42), .B1(n44), .B2(indexY[3]), .ZN(n113) ); OAI221_X2 U11 ( .B1(n118), .B2(n119), .C1(n120), .C2(n121), .A(n122), .ZN( n109) ); AOI221_X2 U12 ( .B1(n81), .B2(n123), .C1(n71), .C2(n124), .A(n125), .ZN(n88) ); ... NAND3_X2 U583 ( .A1(indexX[1]), .A2(n50), .A3(n74), .ZN(n133) ); NAND3_X2 U584 ( .A1(indexX[0]), .A2(n78), .A3(n82), .ZN(n417) ); NAND3_X2 U585 ( .A1(indexX[2]), .A2(n55), .A3(n60), .ZN(n357) ); NOR2_X2 U586 ( .A1(indexY[3]), .A2(n10), .ZN(n117) ); NOR2_X2 U587 ( .A1(indexX[0]), .A2(n78), .ZN(n348) ); INV_X4 U588 ( .A(indexX[0]), .ZN(n55) ); INV_X4 U589 ( .A(indexX[1]), .ZN(n46) ); INV_X4 U590 ( .A(indexY[2]), .ZN(n78) ); INV_X4 U591 ( .A(indexX[3]), .ZN(n35) ); endmodule module regOut ( inp, outp, clk, reset ); input [7:0] inp; output [7:0] outp; input clk, reset; wire n1; SDFF_X2 \outp_reg[7] ( .D(1'b0), .SI(n1), .SE(inp[7]), .CK(clk), .Q(outp[7]) ); SDFF_X2 \outp_reg[6] ( .D(1'b0), .SI(n1), .SE(inp[6]), .CK(clk), .Q(outp[6]) ); SDFF_X2 \outp_reg[5] ( .D(1'b0), .SI(n1), .SE(inp[5]), .CK(clk), .Q(outp[5]) ); SDFF_X2 \outp_reg[4] ( .D(1'b0), .SI(n1), .SE(inp[4]), .CK(clk), .Q(outp[4]) ); SDFF_X2 \outp_reg[3] ( .D(1'b0), .SI(n1), .SE(inp[3]), .CK(clk), .Q(outp[3]) ); SDFF_X2 \outp_reg[2] ( .D(1'b0), .SI(n1), .SE(inp[2]), .CK(clk), .Q(outp[2]) ); SDFF_X2 \outp_reg[1] ( .D(1'b0), .SI(n1), .SE(inp[1]), .CK(clk), .Q(outp[1]) ); SDFF_X2 \outp_reg[0] ( .D(1'b0), .SI(n1), .SE(inp[0]), .CK(clk), .Q(outp[0]) ); INV_X4 U1 ( .A(reset), .ZN(n1) ); endmodule module Sbox_1 ( indexX, indexY, clk, reset, out_port ); input [3:0] indexX; input [3:0] indexY; output [7:0] out_port; input clk, reset; wire [7:0] temp; lookup ins_lookup ( .indexX(indexX), .indexY(indexY), .intermediate(temp) ); regOut ins_regout ( .inp(temp), .outp(out_port), .clk(clk), .reset(reset) ); endmodule
I was looking at your previous post earlier today and was going to ask you why a D-FF was implemented as:hi Dear ads-ee
my problem solved , actually the problem was not about lookup module(combinational part) , i dont know why regOut (sequential logic) work incorrectly after syntheses , i try to change of used flip flops form SDFF to DFF and also add sttribute 'set_dont_touch' for signal reset of regOut and everything work correctly . acutally i still don't why should changing flip flop type helped
SDFF_X2 \outp_reg[7] ( .D(1'b0), .SI(n1), .SE(inp[7]), .CK(clk), .Q(outp[7]) );
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?