Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Alarm clock verilog code cannot compile

Status
Not open for further replies.

Taffs

Newbie level 4
Newbie level 4
Joined
Sep 5, 2015
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
99
Here is the code I created


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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
module clk_24hours
(
output reg[4:0]hr_time,  
output reg[5:0]min_time,
output buzzer_mode,
input clk,
input [4:0] hr_adv,
input[5:0] min_adv,
input [1:0] mode,
input set_time);
  
  input alarm_is_set;
  
  output hr_selected, min_selected, ahr_selected, amin_selected;
  input [1:0] sel1, sel2, sel3, sel4; 
 
 input [1:0] hr1, hr2, hr3, hr4, hr5, hr6, hr7, hr8, hr9, hr10, hr11, hr12, hr13, hr14, hr15, hr16, hr17,
  hr18, hr19, hr20, hr21, hr22, hr23;
  
  input [1:0] ahr1, ahr2, ahr3, ahr4, ahr5, ahr6, ahr7, ahr8, ahr9, ahr10, ahr11, ahr12, ahr13, ahr14, ahr15, ahr16, ahr17,
  ahr18, ahr19, ahr20, ahr21, ahr22, ahr23;
   
  input [1:0] min1, min2, min3, min4, min5, min6, min7, min8, min9, min10, min11, min12, min13, min14, min15, min16, min17,
  min18, min19, min20, min21, min22, min23, min24, min25, min26, min27, min28, min29, min30, min31, min32, min33, min34, min35, min36, min37, 
  min38, min39, min40, min41, min42, min43, min44, min45, min46, min47, min48, min49, min50, min51, min52, min53, min54, min55,
  min56, min57,
  min58, min59;
  
  input [1:0] amin1, amin2, amin3, amin4, amin5, amin6, amin7, amin8, amin9, amin10, amin11, amin12, amin13, amin14, amin15, amin16, amin17,
  amin18, amin19, amin20, amin21, amin22, amin23, amin24, amin25, amin26, amin27, amin28, amin29, amin30, amin31, amin32, amin33, amin34, amin35, 
  amin36, amin37, amin38, amin39, amin40, amin41, amin42, amin43, amin44, amin45, amin46, amin47, amin48, amin49, amin50, amin51, amin52, amin53, amin54, amin55,
  amin56, amin57,
  amin58, amin59;
 
 output reg[1:0] select_ed, select_ed1, select_ed2, select_ed3; 
  
 output reg normal_mode = 2'b00;
 output reg time_set_mode = 2'b01;
 output reg alarm_set_mode = 2'b10;
 output reg alarm_mode = 2'b11;
 
 if(alarm_is_set == 1'b1)
   begin
    assign  mode = alarm_mode;
      
  if(alarm_is_set != 1'b1)
     
    assign  mode = normal_mode;
      
    end
      
 
 always@(posedge clk)
 begin
 if(mode == normal_mode)        //normal mode
   begin
  
    assign min_time = min_selected; 
    min_selected = min_adv;
    min_adv <= min_adv + 1;
    if(min_adv == 6'd59)
    
   min_adv = 0;
   
    else if(min_adv != 6'd59)
      min_adv <= min_adv + 1;
 end
    assign hr_time = hr_selected;
    hr_time = hr_adv;
    #60 hr_adv <= hr_adv + 1;
    if(hr_adv == 5'd23 && min_adv == 6'd59)
      begin
     hr_adv = 0;
    min_adv = 0;
    mode = normal_mode;
 
   end
 end
 
 
if(mode == time_set_mode)     
 
                              
 always @(sel1 or hr1 or hr2 or hr3 or hr4 or hr5 or hr6 or hr7 or hr8 or hr9 or hr10 or hr11 or hr12 or hr13 or hr14 or hr15 or hr16
or hr17 or
hr18 or hr19 or hr20 or hr21 or hr22 or hr23)
   begin 
 
     case (sel1) 
 
       5'd0: select_ed = hr1; 
 
       5'd1: select_ed = hr2; 
 
       5'd2: select_ed = hr3; 
 
       5'd3: select_ed = hr4; 
       
       5'd4: select_ed = hr5; 
 
       5'd5: select_ed = hr6; 
 
       5'd6: select_ed = hr7; 
 
       5'd7: select_ed = hr8;  
 
       5'd8: select_ed = hr9; 
 
       5'd9: select_ed = hr10;
 
       5'd10: select_ed = hr11;
 
       5'd11: select_ed = hr12; 
 
       5'd12: select_ed = hr13; 
 
       5'd13: select_ed = hr14; 
       
       5'd14: select_ed = hr15; 
 
       5'd15: select_ed = hr16; 
 
       5'd16: select_ed = hr17; 
 
       5'd17: select_ed = hr18;  
 
       5'd18: select_ed = hr19; 
 
       5'd19: select_ed = hr20;
 
       5'd20: select_ed = hr21; 
 
       5'd21: select_ed = hr22;
 
       5'd22: select_ed = hr23; 
 
      
     endcase 
 
 hr_selected = sel1;
 
 
   end 
   
   always @(sel2 or min1 or min2 or min3 or min4 or min5 or min6 or min7 or min8 or min9 or min10 or min11 or min12 or min13
  or min14 or min15 or min16 or min17 or
  min18 or min19 or min20 or min21 or min22 or min23 or min24 or min25 or min26 or min27 or min28 or min29 or 
  min30 or min31 or min32 or min33 or min34 or min35 or min36 or min37 or 
  min38 or min39 or min40 or min41 or min42 or min43 or min44 or min45 or min46 or min47 or min48 or min49 or min50 or min51 or min52 or
  min53 or min54 or min55 or
  min56 or min57 or
  min58 or min59)
 
   begin 
 
     case (sel2) 
 
       6'd0: select_ed1 = min1; 
 
       6'd1: select_ed1 = min2; 
 
       6'd2: select_ed1 = min3; 
 
       6'd3: select_ed1 = min4; 
       
       6'd4: select_ed1 = min5; 
 
       6'd5: select_ed1 = min6; 
 
       6'd6: select_ed1 = min7; 
 
       6'd7: select_ed1 = min8;  
 
       6'd8: select_ed1 = min9; 
 
       6'd9: select_ed1 = min10;
 
       6'd10: select_ed1 = min11;
 
       6'd11: select_ed1 = min12; 
 
       6'd12: select_ed1 = min13; 
 
       6'd13: select_ed1 = min14; 
       
       6'd14: select_ed1 = min15; 
 
       6'd15: select_ed1 = min16; 
 
       6'd16: select_ed1 = min17; 
 
       6'd17: select_ed1 = min18;  
 
       6'd18: select_ed1 = min19; 
 
       6'd19: select_ed1 = min20;
 
       6'd20: select_ed1 = min21; 
 
       6'd21: select_ed1 = min22;
 
       6'd22: select_ed1 = min23; 
       
       6'd23: select_ed1 = min24; 
       
       6'd24: select_ed1 = min25; 
 
       6'd25: select_ed1 = min26; 
 
       6'd26: select_ed1 = min27; 
 
       6'd27: select_ed1 = min28;  
 
       6'd28: select_ed1 = min29; 
 
       6'd29: select_ed1 = min30;
 
       6'd30: select_ed1 = min31;
 
       6'd31: select_ed1 = min32; 
 
       6'd32: select_ed1 = min33; 
 
       6'd33: select_ed1 = min34; 
       
       6'd34: select_ed1 = min35; 
 
       6'd35: select_ed1 = min36; 
 
       6'd36: select_ed1 = min37; 
 
       6'd37: select_ed1 = min38;  
 
       6'd38: select_ed1 = min39; 
 
       6'd39: select_ed1 = min40;
 
       6'd40: select_ed1 = min41; 
 
       6'd41: select_ed1 = min42;
 
       6'd42: select_ed1 = min43; 
      
       6'd43: select_ed1 = min44; 
       
       6'd44: select_ed1 = min45; 
 
       6'd45: select_ed1 = min46; 
 
       6'd46: select_ed1 = min47; 
 
       6'd47: select_ed1 = min48;  
 
       6'd48: select_ed1 = min49;
       
       6'd49: select_ed1 = min50;
       
       6'd50: select_ed1 = min51; 
 
       6'd51: select_ed1 = min52; 
 
       6'd52: select_ed1 = min53; 
 
       6'd53: select_ed1 = min54; 
       
       6'd54: select_ed1 = min55; 
 
       6'd55: select_ed1 = min56; 
 
       6'd56: select_ed1 = min57; 
 
       6'd57: select_ed1 = min58;  
 
       6'd58: select_ed1 = min59; 
       
     endcase 
     
    min_selected = sel2;
   
 end
 
 if(mode == alarm_set_mode)
  
  always @(sel3 or ahr1 or ahr2 or ahr3 or ahr4 or ahr5 or ahr6 or ahr7 or ahr8 or ahr9 or ahr10 or ahr11 or 
  ahr12 or ahr13 or ahr14 or ahr15 
  or ahr16
or ahr17 or
ahr18 or ahr19 or ahr20 or ahr21 or ahr22 or ahr23)
   
   begin
   
 
     case (sel3) 
 
       5'd0: select_ed2 = ahr1; 
 
       5'd1: select_ed2 = ahr2; 
 
       5'd2: select_ed2 = ahr3; 
 
       5'd3: select_ed2 = ahr4; 
       
       5'd4: select_ed2 = ahr5; 
 
       5'd5: select_ed2 = ahr6; 
 
       5'd6: select_ed2 = ahr7; 
 
       5'd7: select_ed2 = ahr8;  
 
       5'd8: select_ed2 = ahr9; 
 
       5'd9: select_ed2 = ahr10;
 
       5'd10: select_ed2 = ahr11;
 
       5'd11: select_ed2 = ahr12; 
 
       5'd12: select_ed2 = ahr13; 
 
       5'd13: select_ed2 = ahr14; 
       
       5'd14: select_ed2 = ahr15; 
 
       5'd15: select_ed2 = ahr16; 
 
       5'd16: select_ed2 = ahr17; 
 
       5'd17: select_ed2 = ahr18;  
 
       5'd18: select_ed2 = ahr19; 
 
       5'd19: select_ed2 = ahr20;
 
       5'd20: select_ed2 = ahr21; 
 
       5'd21: select_ed2 = ahr22;
 
       5'd22: select_ed2 = ahr23; 
 
      
     endcase 
 
 ahr_selected = sel3;
 
 
   end 
 
   always @(sel4 or amin1 or amin2 or amin3 or amin4 or amin5 or amin6 or amin7 or amin8 or amin9 or amin10 or amin11 or amin12 or amin13
  or amin14 or amin15 or amin16 or amin17 or amin18 or amin19 or amin20 or amin21 or amin22 or amin23 or amin24 or amin25 or amin26 or amin27 or amin28 or amin29 or amin30 or amin31 or amin32 or amin33 or amin34 or amin35 or amin36 or amin37 or 
  amin38 or amin39 or amin40 or amin41 or amin42 or amin43 or amin44 or amin45 or amin46 or amin47 or amin48 or amin49 or amin50 or amin51 or amin52 or
  amin53 or amin54 or amin55 or
  amin56 or amin57 or
  amin58 or amin59)
 
   begin 
 
     case (sel4) 
 
       6'd0: select_ed3 = amin1; 
 
       6'd1: select_ed3 = amin2; 
 
       6'd2: select_ed3 = amin3; 
 
       6'd3: select_ed3 = amin4; 
       
       6'd4: select_ed3 = amin5; 
 
       6'd5: select_ed3 = amin6; 
 
       6'd6: select_ed3 = amin7; 
 
       6'd7: select_ed3 = amin8;  
 
       6'd8: select_ed3 = amin9; 
 
       6'd9: select_ed3 = amin10;
 
       6'd10: select_ed3 = amin11;
 
       6'd11: select_ed3 = amin12; 
 
       6'd12: select_ed3 = amin13; 
 
       6'd13: select_ed3 = amin14; 
       
       6'd14: select_ed3 = amin15; 
 
       6'd15: select_ed3 = amin16; 
 
       6'd16: select_ed3 = amin17; 
 
       6'd17: select_ed3 = amin18;  
 
       6'd18: select_ed3 = amin19; 
 
       6'd19: select_ed3 = amin20;
 
       6'd20: select_ed3 = amin21; 
 
       6'd21: select_ed3 = amin22;
 
       6'd22: select_ed3 = amin23; 
       
       6'd23: select_ed3 = amin24; 
       
       6'd24: select_ed3 = amin25; 
 
       6'd25: select_ed3 = amin26; 
 
       6'd26: select_ed3 = amin27; 
 
       6'd27: select_ed3 = amin28;  
 
       6'd28: select_ed3 = amin29; 
 
       6'd29: select_ed3 = amin30;
 
       6'd30: select_ed3 = amin31;
 
       6'd31: select_ed3 = amin32; 
 
       6'd32: select_ed3 = amin33; 
 
       6'd33: select_ed3 = amin34; 
       
       6'd34: select_ed3 = amin35; 
 
       6'd35: select_ed3 = amin36; 
 
       6'd36: select_ed3 = amin37; 
 
       6'd37: select_ed3 = amin38;  
 
       6'd38: select_ed3 = amin39; 
 
       6'd39: select_ed3 = amin40;
 
       6'd40: select_ed3 = amin41; 
 
       6'd41: select_ed3 = amin42;
 
       6'd42: select_ed3 = amin43; 
      
       6'd43: select_ed3 = amin44; 
       
       6'd44: select_ed3 = amin45; 
 
       6'd45: select_ed3 = amin46; 
 
       6'd46: select_ed3 = amin47; 
 
       6'd47: select_ed3 = amin48;  
 
       6'd48: select_ed3 = amin49;
       
       6'd49: select_ed3 = amin50;
       
       6'd50: select_ed3 = amin51; 
 
       6'd51: select_ed3 = amin52; 
 
       6'd52: select_ed3 = amin53; 
 
       6'd53: select_ed3 = amin54; 
       
       6'd54: select_ed3 = amin55; 
 
       6'd55: select_ed3 = amin56; 
 
       6'd56: select_ed3 = amin57; 
 
       6'd57: select_ed3 = amin58;  
 
       6'd58: select_ed3 = amin59; 
       
     endcase 
     
    amin_selected = sel4;
   
 end
 
 if(mode == alarm_mode)
   begin
   if (amin_selected == min_adv && ahr_selected == hr_adv)
    assign buzzer_mode = 1'b1;
     
   else 
     assign buzzer_mode = 1'b0;
   
 end
 end
 
end module



It keeps saying that there is an unexpected end just before the end module. I have tried many ways to readjust but still cannot compile. I am a newbie, please help. Thanks
 
Last edited by a moderator:

This language is not my expertise and I didn't take a deep look, but at the line 81, after the expression if(mode == time_set_mode) the following statements shouldn't be enclosured by begin-end delimiters ?
 

Hi, it still give the same problem and statement. It keeps pointing at the end before the end module.

I cleared all the problems of the delimiters. Now its pointing twoards the end module saying unexpected end
 

Try replacing the above end module statement by endmodule, just a guess.
 

Try replacing the above end module statement by endmodule, just a guess.

Now it gives me this
Code:
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(15): In, out, or inout does not appear in port list: sel1.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(15): In, out, or inout does not appear in port list: sel2.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(15): In, out, or inout does not appear in port list: sel3.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(15): In, out, or inout does not appear in port list: sel4.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr1.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr2.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr3.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr4.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr5.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr6.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr7.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr8.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr9.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr10.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr11.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr12.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr13.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr14.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr15.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr16.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(17): In, out, or inout does not appear in port list: hr17.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(18): In, out, or inout does not appear in port list: hr18.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(18): In, out, or inout does not appear in port list: hr19.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(18): In, out, or inout does not appear in port list: hr20.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(18): In, out, or inout does not appear in port list: hr21.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(18): In, out, or inout does not appear in port list: hr22.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(18): In, out, or inout does not appear in port list: hr23.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr1.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr2.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr3.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr4.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr5.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr6.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr7.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr8.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr9.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr10.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr11.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr12.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr13.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr14.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr15.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr16.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(20): In, out, or inout does not appear in port list: ahr17.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(21): In, out, or inout does not appear in port list: ahr18.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(21): In, out, or inout does not appear in port list: ahr19.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(21): In, out, or inout does not appear in port list: ahr20.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(21): In, out, or inout does not appear in port list: ahr21.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(21): In, out, or inout does not appear in port list: ahr22.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(21): In, out, or inout does not appear in port list: ahr23.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min1.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min2.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min3.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min4.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min5.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min6.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min7.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min8.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min9.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min10.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min11.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min12.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min13.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min14.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min15.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min16.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(23): In, out, or inout does not appear in port list: min17.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min18.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min19.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min20.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min21.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min22.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min23.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min24.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min25.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min26.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min27.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min28.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min29.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min30.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min31.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min32.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min33.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min34.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min35.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min36.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(24): In, out, or inout does not appear in port list: min37.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min38.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min39.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min40.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min41.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min42.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min43.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min44.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min45.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min46.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min47.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min48.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min49.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min50.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min51.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min52.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min53.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min54.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(25): In, out, or inout does not appear in port list: min55.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(26): In, out, or inout does not appear in port list: min56.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(26): In, out, or inout does not appear in port list: min57.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(27): In, out, or inout does not appear in port list: min58.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(27): In, out, or inout does not appear in port list: min59.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin1.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin2.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin3.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin4.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin5.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin6.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin7.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin8.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin9.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin10.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin11.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin12.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin13.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin14.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin15.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin16.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(29): In, out, or inout does not appear in port list: amin17.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin18.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin19.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin20.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin21.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin22.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin23.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin24.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin25.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin26.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin27.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin28.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin29.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin30.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin31.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin32.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin33.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin34.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(30): In, out, or inout does not appear in port list: amin35.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin36.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin37.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin38.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin39.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin40.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin41.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin42.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin43.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin44.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin45.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin46.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin47.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin48.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin49.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin50.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin51.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin52.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin53.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin54.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(31): In, out, or inout does not appear in port list: amin55.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(32): In, out, or inout does not appear in port list: amin56.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(32): In, out, or inout does not appear in port list: amin57.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(33): In, out, or inout does not appear in port list: amin58.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(33): In, out, or inout does not appear in port list: amin59.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(35): In, out, or inout does not appear in port list: select_ed.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(35): In, out, or inout does not appear in port list: select_ed1.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(35): In, out, or inout does not appear in port list: select_ed2.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(35): In, out, or inout does not appear in port list: select_ed3.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(37): In, out, or inout does not appear in port list: normal_mode.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(38): In, out, or inout does not appear in port list: time_set_mode.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(39): In, out, or inout does not appear in port list: alarm_set_mode.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(40): In, out, or inout does not appear in port list: alarm_mode.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(12): In, out, or inout does not appear in port list: alarm_is_set.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(42): The generate if condition must be a constant expression.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(46): The generate if condition must be a constant expression.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(81): The generate if condition must be a constant expression.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(284): The generate if condition must be a constant expression.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(488): The generate if condition must be a constant expression.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(14): In, out, or inout does not appear in port list: amin_selected.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(14): In, out, or inout does not appear in port list: ahr_selected.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(490): The generate if condition must be a constant expression.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(14): In, out, or inout does not appear in port list: hr_selected.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(14): In, out, or inout does not appear in port list: min_selected.
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(59): (vlog-2110) Illegal reference to net "min_selected".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(60): (vlog-2110) Illegal reference to net "min_adv".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(63): (vlog-2110) Illegal reference to net "min_adv".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(66): (vlog-2110) Illegal reference to net "min_adv".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(70): (vlog-2110) Illegal reference to net "hr_adv".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(73): (vlog-2110) Illegal reference to net "hr_adv".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(74): (vlog-2110) Illegal reference to net "min_adv".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(75): (vlog-2110) Illegal reference to net "mode".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(140): (vlog-2110) Illegal reference to net "hr_selected".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(278): (vlog-2110) Illegal reference to net "min_selected".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(346): (vlog-2110) Illegal reference to net "ahr_selected".
** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(482): (vlog-2110) Illegal reference to net "amin_selected".
 
Last edited by a moderator:

I should've put the input and output in ports I guess, I did that but another error.

** Error: C:/Users/Taffy/Desktop/Hometryout/tryouts.v(11): near "input": syntax error, unexpected input, expecting ')'
 
Last edited by a moderator:

I'm a little confused by this code. For example, the variable "alarm_is_set" should't be present within the module argument list ?


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
module clk_24hours
(
output reg[4:0]hr_time,  
output reg[5:0]min_time,
output buzzer_mode,
input clk,
input [4:0] hr_adv,
input[5:0] min_adv,
input [1:0] mode,
input set_time);



Moreover, you are performing evaluation of this variable in some parts of the code, but no previous value had been assigned anywhere:


Code Verilog - [expand]
1
2
3
if(alarm_is_set == 1'b1)
       begin
        ...

 

Hi,
The code in the #1 post have an extra end at line number 493 its not needed.
Also i don't know why you are giving input/output declarations for the non-port internal signals from line numbers 12 to 40 in the code in #1 post. You can declare these internal signals as either wire/reg.
 

Dear OP,
You have made glaring mistakes and these are not blunders. All of these indicates that you should to go back, study Verilog and learn your basics properly. Later I would recommend you to start writing smaller & simpler codes.
 

As dpaul mentioned you need to learn Verilog first before writing such a large chunk of code. You should also keep in mind that Verilog is a Hardare Description Language and is not a programming language.

You've used if statements in a number of locations that are not within procedural statements, this is incorrect and will generate errors when you get rid of all the other syntax errors.

You've basically violated so many syntax rules that the compilation is just flagging the grossest errors (e.g. the end module v.s. endmodule).

Either go look up samples of Verilog code from places like https://www.asic-world.com/ and/or get a book on Verilog, then try again with a much smaller and simpler design.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top