I'm trying to write re-usable modules and have run into a problem. The code follows:
35 always @(BTN) begin
36 case (BTN)
37 4'b0001:
38 begin
39 digit1 <= digit1 + 1;
40 sevensegcase digi1 ( // the module i'm trying to reuse
41 .SEG_SEL_IN(n2B0[1:0], // n2B0 is a defined constant
42 .BIN_IN(digit1[3:0]),
43 .DOT_IN(n1B1), // another constant
44 .SEG_SEL_OUT(AN[3:0]), // Send digit selection to the anodes
45 .HEX_OUT(A_TO_G[7:0])); // Select appropriate segments
46 end
......
......
......
When I save the module, it compiles with errors.
When I Synthesize the module I get:
ERROR:HDLCompliers:26 - "Seven_Seg.v" line 40 unexpected token 'sevensegcase'
If I place the instantiation outside the always block I get the same error.