OpenCores
URL https://opencores.org/ocsvn/or1200gct/or1200gct/trunk

Subversion Repositories or1200gct

[/] [or1200gct/] [tags/] [arelease/] [or1200.tk] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jcastillo
#//////////////////////////////////////////////////////////////////////
2
#////                                                              ////
3
#////  OR1200 graphic configuration tool                           ////
4
#////                                                              ////
5
#////  Description                                                 ////
6
#////  Graphic configuration tool for OR1200 core                  ////
7
#////                                                              ////
8
#////  To Do:                                                      ////
9
#////   - find bugs                                                ////
10
#////                                                              ////
11
#////  Author(s):                                                  ////
12
#////      - Javier Castillo, jcastillo@opencores.org              ////
13
#////                                                              ////
14
#//////////////////////////////////////////////////////////////////////
15
#////                                                              ////
16
#//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
17
#////                                                              ////
18
#//// This source file may be used and distributed without         ////
19
#//// restriction provided that this copyright statement is not    ////
20
#//// removed from the file and that any derivative work contains  ////
21
#//// the original copyright notice and the associated disclaimer. ////
22
#////                                                              ////
23
#//// This source file is free software; you can redistribute it   ////
24
#//// and/or modify it under the terms of the GNU Lesser General   ////
25
#//// Public License as published by the Free Software Foundation; ////
26
#//// either version 2.1 of the License, or (at your option) any   ////
27
#//// later version.                                               ////
28
#////                                                              ////
29
#//// This source is distributed in the hope that it will be       ////
30
#//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
31
#//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
32
#//// PURPOSE.  See the GNU Lesser General Public License for more ////
33
#//// details.                                                     ////
34
#////                                                              ////
35
#//// You should have received a copy of the GNU Lesser General    ////
36
#//// Public License along with this source; if not, download it   ////
37
#//// from http://www.opencores.org/lgpl.shtml                     ////
38
#////                                                              ////
39
#//////////////////////////////////////////////////////////////////////
40
#//
41
#// CVS Revision History
42
#//
43
#// $Log: not supported by cvs2svn $
44
 
45
 
46
#Defines variables for parameters and its default values
47
 
48
 
49
proc defaultvals { } {
50
  global ASIC
51
  global VCD_DUMP
52
  global VERBOSE
53
  global targetFPGA
54
  global targetASIC
55
  global ASIC_MULTP2_32X32
56
  global BIST
57
  global RF_RAM
58
 
59
  #Wishbone defines
60
  global REGISTERED_OUTPUTS
61
  global REGISTERED_INPUTS
62
  global NO_BURSTS
63
  global WB_RETRY
64
  global WB_CAB
65
  global WB_B3
66
  global CLKDIV2_SUPPORT
67
  global CLKDIV4_SUPPORT
68
 
69
  #Misc
70
  global ADDITIONAL_SYNOPSYS_DIRECTIVES
71
  global CASE_DEFAULT
72
  global IMPL_MEM2REG
73
 
74
  #IU defines
75
  global SR_EPH_DEF
76
  global IMPL_ADDC
77
  global IMPL_CY
78
  global ADDITIONAL_FLAG_MODIFIERS
79
  global IMPL_DIV
80
  global IMPL_ALU_ROTATE
81
  global MULT_IMPLEMENTED
82
  global LWPWR_MULT
83
  global ALU_COMP
84
 
85
  #PM defines
86
  global PM_IMPLEMENTED
87
  global PM_READREGS
88
  global PM_UNUSED_ZERO
89
  global PM_PARTIAL_DECODING
90
 
91
  #DU defines
92
  global DU_IMPLEMENTED
93
  global DU_HWBKPTS
94
  global DU_TB_IMPLEMENTED
95
  global DU_READREGS
96
  global DU_UNUSED_ZERO
97
  global DU_STATUS_UNIMPLEMENTED
98
 
99
  #PIC defines
100
  global PIC_IMPLEMENTED
101
  global PIC_READREGS
102
  global PIC_UNUSED_ZERO
103
  global PIC_PICMR
104
  global PIC_PICSR
105
  global PIC_INTS
106
 
107
  #TT defines
108
  global TT_IMPLEMENTED
109
  global TT_TTMR
110
  global TT_TTSR
111
  global TT_READREGS
112
 
113
 
114
  #IC CACHES
115
  global NO_IC
116
  global IC_WAYS
117
  global IC_SIZE
118
  global ICLS
119
 
120
  #DC defines
121
  global NO_DC
122
  global DC_WAYS
123
  global DC_SIZE
124
  global DCLS
125
  global SB_IMPLEMENTED
126
  global SB_ENTRIES
127
  global SB_LOG
128
 
129
  #MMU defines
130
  global NO_IMMU
131
  global NO_DMMU
132
 
133
  #QMEM defines
134
  global QMEM_IMPLEMENTED
135
  global QMEM_BSEL
136
  global QMEM_ACK
137
 
138
  #MISC defines
139
  global MAC_IMPLEMENTED
140
  global MAC_SPR_WE
141
  global CFGR_IMPLEMENTED
142
  global SYS_FULL_DECODE
143
 
144
  #Target defines
145
  set ASIC 0
146
  set VCD_DUMP 0
147
  set VERBOSE 0
148
  set targetFPGA XILINX_RAMB4
149
  set targetASIC VIRTUALSILICON_SSP
150
  set ASIC_MULTP2_32X32 0
151
  set BIST 0
152
  set RF_RAM 2
153
 
154
  #Wishbone defines
155
  set REGISTERED_OUTPUTS 1
156
  set REGISTERED_INPUTS 0
157
  set NO_BURSTS 0
158
  set WB_RETRY 0
159
  set WB_CAB 1
160
  set WB_B3 0
161
  set CLKDIV2_SUPPORT 1
162
  set CLKDIV4_SUPPORT 0
163
 
164
  #Misc
165
  set ADDITIONAL_SYNOPSYS_DIRECTIVES 0
166
  set CASE_DEFAULT 1
167
  set IMPL_MEM2REG 1
168
 
169
  #IU defines
170
  set SR_EPH_DEF 0
171
  set IMPL_ADDC 1
172
  set IMPL_CY 1
173
  set ADDITIONAL_FLAG_MODIFIERS 0
174
  set IMPL_DIV 0
175
  set IMPL_ALU_ROTATE 0
176
  set MULT_IMPLEMENTED 1
177
  set LWPWR_MULT 0
178
  set ALU_COMP 2
179
 
180
  #PM defines
181
  set PM_IMPLEMENTED 1
182
  set PM_READREGS 1
183
  set PM_UNUSED_ZERO 1
184
  set PM_PARTIAL_DECODING 1
185
 
186
  #DU defines
187
  set DU_IMPLEMENTED 1
188
  set DU_HWBKPTS 0
189
  if { $ASIC==0 && ( $targetFPGA=="XILINX_RAMB4" || $targetFPGA=="XILINX_RAM32x1D" ) } {
190
    set DU_TB_IMPLEMENTED 1
191
  } else {
192
    set DU_TB_IMPLEMENTED 0
193
  }
194
  set DU_READREGS 1
195
  set DU_UNUSED_ZERO 1
196
  set DU_STATUS_UNIMPLEMENTED 1
197
 
198
  #PIC defines
199
  set PIC_IMPLEMENTED 1
200
  set PIC_READREGS 1
201
  set PIC_UNUSED_ZERO 1
202
  set PIC_PICMR 1
203
  set PIC_PICSR 1
204
  set PIC_INTS 20
205
 
206
  #TT defines
207
  set TT_IMPLEMENTED 1
208
  set TT_TTMR 1
209
  set TT_TTSR 1
210
  set TT_READREGS 1
211
 
212
  #IC defines
213
  set NO_IC 0
214
  set IC_WAYS  1
215
  set IC_SIZE  8KB
216
  set ICLS 16
217
 
218
  #DC defines
219
  set NO_DC 0
220
  set DC_WAYS 1
221
  set DC_SIZE 8KB
222
  set DCLS 16
223
  set SB_IMPLEMENTED 0
224
  set SB_ENTRIES 4
225
  set SB_LOG 2
226
 
227
  #MMU defines
228
  set NO_IMMU 0
229
  set NO_DMMU 0
230
 
231
  #QMEM defines
232
  set QMEM_IMPLEMENTED 0
233
  set QMEM_BSEL 0
234
  set QMEM_ACK 0
235
 
236
  #MISC defines
237
  set MAC_IMPLEMENTED 1
238
  set MAC_SPR_WE 1
239
  set CFGR_IMPLEMENTED 1
240
  set SYS_FULL_DECODE 1
241
 
242
}
243
 
244
 
245
#Target memories
246
lappend memFPGA "GENERIC" "ALTERA_LPM" "XILINX_RAMB4" "XILINX_RAM32x1D" "USE_RAM16x1D_FOR_RAM32X1D"
247
lappend memASIC "GENERIC" "ARTISAN_SSP" "ARTISAN_SDP" "ARTISAN_STP" "VIRTUALSILICON_SSP" "VIRTUALSILICON_STP_T1" "VIRTUALSILICON_STP_T2"
248
 
249
 
250
 
251
 
252
proc confFPGA { } {
253
 
254
global memFPGA
255
global ASIC_MULTP2_32X32
256
global targetFPGA
257
global RF_RAM
258
 
259
destroy .screen.memframe
260
destroy .screen.multframe
261
destroy .screen.bistframe
262
destroy .screen.rfframe
263
 
264
#Create a frame for the memory type selection
265
frame .screen.memframe -bd 2 -relief groove
266
pack .screen.memframe -side left -padx 2m -pady 2m
267
label .screen.memframe.meml -text "Target FPGA memories"
268
pack .screen.memframe.meml -side top
269
 
270
#Create the list for memories
271
set i 1
272
 
273
foreach mem $memFPGA {
274
  radiobutton .screen.memframe.b$i -text $mem -variable targetFPGA -value $mem
275
  pack .screen.memframe.b$i -side top -anchor w
276
  incr i 1
277
}
278
 
279
#Create a frame for Register File memory type
280
frame .screen.rfframe -bd 2 -relief groove
281
pack .screen.rfframe -side top -padx 2m -pady 2m
282
label .screen.rfframe.rflab1 -text "Type of Register File RAM"
283
pack .screen.rfframe.rflab1 -side top
284
radiobutton .screen.rfframe.rf1 -text "Generic (flip-flop based) " -variable RF_RAM -value 0
285
radiobutton .screen.rfframe.rf2 -text "Two port RAM" -variable RF_RAM -value 1
286
radiobutton .screen.rfframe.rf3 -text "Dual port RAM" -variable RF_RAM -value 2
287
pack .screen.rfframe.rf1 .screen.rfframe.rf2 .screen.rfframe.rf3 -side top -anchor w
288
 
289
 
290
#Create a frame for the multiplier type selection
291
set ASIC_MULTP2_32X32 0
292
frame .screen.multframe -bd 2 -relief groove
293
pack .screen.multframe -side left -padx 2m -pady 2m
294
label .screen.multframe.multl -text "Multiplier"
295
pack .screen.multframe.multl -side top
296
radiobutton .screen.multframe.rmul1 -text "GENERIC  32x32 MULTIPLIER" -variable ASIC_MULTP2_32X32 -value 0
297
pack .screen.multframe.rmul1 -side top -anchor w
298
 
299
 
300
 
301
}
302
 
303
 
304
proc confASIC { } {
305
#Global var with all the posible target memories for ASIC
306
global memASIC
307
global targetASIC
308
global ASIC_MULTP2_32X32
309
global RF_RAM
310
 
311
destroy .screen.memframe
312
destroy .screen.multframe
313
destroy .screen.bistframe
314
destroy .screen.rfframe
315
 
316
#Create a frame for the memory type selection
317
frame .screen.memframe -bd 2 -relief groove
318
pack .screen.memframe -side left -padx 2m -pady 2m
319
label .screen.memframe.meml -text "Target ASIC memories"
320
pack .screen.memframe.meml -side top
321
 
322
#Create the list for memories
323
set i 1
324
 
325
foreach mem $memASIC {
326
  radiobutton .screen.memframe.b$i -text $mem -variable targetASIC -value $mem
327
  pack .screen.memframe.b$i -side top -anchor w
328
  incr i 1
329
}
330
 
331
#Create a frame for Register File memory type
332
frame .screen.rfframe -bd 2 -relief groove
333
pack .screen.rfframe -side top -padx 2m -pady 2m
334
label .screen.rfframe.rflab1 -text "Type of Register File RAM"
335
pack .screen.rfframe.rflab1 -side top
336
radiobutton .screen.rfframe.rf1 -text "Generic (flip-flop based) " -variable RF_RAM -value 0
337
radiobutton .screen.rfframe.rf2 -text "Two port RAM" -variable RF_RAM -value 1
338
radiobutton .screen.rfframe.rf3 -text "Dual port RAM" -variable RF_RAM -value 2
339
pack .screen.rfframe.rf1 .screen.rfframe.rf2 .screen.rfframe.rf3 -side top -anchor w
340
 
341
 
342
#Create a frame for the multiplier type selection
343
frame .screen.multframe -bd 2 -relief groove
344
pack .screen.multframe -side top -padx 2m -pady 2m
345
label .screen.multframe.multl -text "Multiplier"
346
pack .screen.multframe.multl -side top
347
radiobutton .screen.multframe.rmul1 -text "GENERIC  32x32 MULTIPLIER" -variable ASIC_MULTP2_32X32 -value 0
348
radiobutton .screen.multframe.rmul2 -text "ASIC 32x32 MULTIPLIER" -variable ASIC_MULTP2_32X32 -value 1
349
pack .screen.multframe.rmul1 -side top -anchor w
350
pack .screen.multframe.rmul2 -side top -anchor w
351
 
352
 
353
}
354
 
355
 
356
 
357
 
358
proc about { } {
359
 toplevel .dabout -class Dialog
360
 wm title .dabout About
361
 wm iconname .dabout Dialog
362
 frame .dabout.top -relief raised -bd 1
363
 pack .dabout.top -side top -fill both
364
 frame .dabout.bot -relief raised -bd 1
365
 pack .dabout.bot -side bottom -fill both
366
 
367
 message .dabout.top.msg -width 5i -font -Adobe-Times-Medium-R-Normal-*-180-* -text "OpenRisc 1200 graphic configuration tool"
368
 message .dabout.top.msg2 -width 5i -font -Adobe-Times-Medium-R-Normal-*-180-* -text "jcastillo@opensocdesign.com"
369
 message .dabout.top.msg3 -width 5i -font -Adobe-Times-Medium-R-Normal-*-180-* -text "Version 0.1"
370
 pack .dabout.top.msg .dabout.top.msg2 .dabout.top.msg3 -side top -expand 1 -fill both -padx 3m -pady 3m
371
 
372
}
373
 
374
 
375
proc confOR1200 { } {
376
 
377
 destroy .d
378
 
379
 toplevel .d -class Dialog
380
 wm title .d "OpenRISC 1200 Core Configuration"
381
 frame .d.left -relief raised -bd 1 -relief flat
382
 frame .d.right -relief raised -bd 1 -relief flat
383
 pack .d.left -side left -fill both
384
 pack .d.right -side right -fill both
385
 
386
 #Add buttons
387
 
388
 button .d.left.iub -text "Integer Unit" -command { confIU }
389
 button .d.left.icb -text "Instruction Cache" -command { confIC }
390
 button .d.left.dcb -text "Data Cache" -command { confDC }
391
 button .d.left.mmub -text "MMU" -command { confMMU }
392
 
393
 button .d.left.dub -text "Debug Unit" -command { confDU }
394
 button .d.left.pmb -text "Power Management" -command { confPM }
395
 button .d.right.picb -text "PIC" -command { confPIC }
396
 button .d.right.ttb -text "Tick Timer" -command { confTT }
397
 button .d.right.qmb -text "Quick Embedded Memory" -command { confQM }
398
 button .d.right.mcb -text "Misc" -command { confMISC }
399
 button .d.right.exb -text "Exit" -command { destroy .d }
400
 
401
 
402
 pack .d.left.iub .d.left.icb .d.left.dcb  .d.left.mmub -padx 10m -fill x
403
 pack .d.left.dub .d.left.pmb .d.right.picb  -padx 10m -fill x
404
 pack .d.right.ttb .d.right.qmb .d.right.mcb .d.right.exb -padx 10m -fill x
405
 
406
}
407
 
408
 
409
proc confIU { } {
410
 
411
 destroy .diu
412
 destroy .dmi
413
 
414
 toplevel .diu -class Dialog
415
 wm title .diu "Integer Unit"
416
 frame .diu.top -relief raised -bd 1 -relief flat
417
 frame .diu.top2 -relief raised -bd 1 -relief groove
418
 frame .diu.top3 -relief raised -bd 1 -relief groove
419
 frame .diu.top4 -relief raised -bd 1 -relief groove
420
 frame .diu.top5 -relief raised -bd 1 -relief groove
421
 frame .diu.top6 -relief raised -bd 1 -relief groove
422
 frame .diu.top7 -relief raised -bd 1 -relief groove
423
 frame .diu.top8 -relief raised -bd 1 -relief groove
424
 frame .diu.top9 -relief raised -bd 1 -relief groove
425
 frame .diu.top10 -relief raised -bd 1 -relief groove
426
 frame .diu.top11 -relief raised -bd 1 -relief groove
427
 
428
 pack .diu.top -side top -fill both
429
 pack .diu.top2 -side top -fill both
430
 pack .diu.top3 -side top -fill both
431
 pack .diu.top4 -side top -fill both
432
 pack .diu.top5 -side top -fill both
433
 pack .diu.top6 -side top -fill both
434
 pack .diu.top7 -side top -fill both
435
 pack .diu.top8 -side top -fill both
436
 pack .diu.top9 -side top -fill both
437
 pack .diu.top10 -side top -fill both
438
 pack .diu.top11 -side top -fill both
439
 
440
 label .diu.top.opl -text "OpenRISC 1200 Integer Unit Configuration" -relief raised
441
 pack .diu.top.opl -side top -pady 5m  -padx 10m
442
 
443
 radiobutton .diu.top2.flashy -text y -variable SR_EPH_DEF -value 1
444
 radiobutton .diu.top2.flashn -text n -variable SR_EPH_DEF -value 0
445
 pack .diu.top2.flashy .diu.top2.flashn -side left
446
 
447
 radiobutton .diu.top3.addcy -text y -variable IMPL_ADDC -value 1
448
 radiobutton .diu.top3.addcn -text n -variable IMPL_ADDC -value 0
449
 pack .diu.top3.addcy .diu.top3.addcn -side left
450
 
451
 radiobutton .diu.top4.cyy -text y -variable IMPL_CY -value 1
452
 radiobutton .diu.top4.cyn -text n -variable IMPL_CY -value 0
453
 pack .diu.top4.cyy .diu.top4.cyn -side left
454
 
455
 radiobutton .diu.top5.addcompy -text y -variable ADDITIONAL_FLAG_MODIFIERS -value 1
456
 radiobutton .diu.top5.addcompn -text n -variable ADDITIONAL_FLAG_MODIFIERS -value 0
457
 pack .diu.top5.addcompy .diu.top5.addcompn -side left
458
 
459
 radiobutton .diu.top6.divy -text y -variable IMPL_DIV -value 1
460
 radiobutton .diu.top6.divn -text n -variable IMPL_DIV -value 0
461
 pack .diu.top6.divy .diu.top6.divn -side left
462
 
463
 radiobutton .diu.top7.roty -text y -variable IMPL_ALU_ROTATE -value 1
464
 radiobutton .diu.top7.rotn -text n -variable IMPL_ALU_ROTATE -value 0
465
 pack .diu.top7.roty .diu.top7.rotn -side left
466
 
467
 radiobutton .diu.top8.muly -text y -variable MULT_IMPLEMENTED -value 1
468
 radiobutton .diu.top8.muln -text n -variable MULT_IMPLEMENTED -value 0
469
 pack .diu.top8.muly .diu.top8.muln -side left
470
 
471
 radiobutton .diu.top9.lpmuly -text y -variable LWPWR_MULT -value 1
472
 radiobutton .diu.top9.lpmuln -text n -variable LWPWR_MULT -value 0
473
 pack .diu.top9.lpmuly .diu.top9.lpmuln -side left
474
 
475
 radiobutton .diu.top10.comp1 -text 1 -variable ALU_COMP -value 1
476
 radiobutton .diu.top10.comp2 -text 2 -variable ALU_COMP -value 2
477
 pack .diu.top10.comp1 .diu.top10.comp2 -side left
478
 
479
 label .diu.top2.flashl -text "   Exception vectors in FLASH"
480
 label .diu.top3.addcl -text "   Implement l.addc instruction"
481
 label .diu.top4.cyl -text "   Implement carry bit SR\[CY\]"
482
 label .diu.top5.fml -text "   Add operations set compare flag when result is zero"
483
 label .diu.top6.divl -text "   Implement optional l.div/l.divu operations"
484
 label .diu.top7.rotl -text "   Implement rotate in the ALU"
485
 label .diu.top8.mull -text "   Implement multiplier"
486
 label .diu.top9.lpmull -text "   Low power multiplier"
487
 label .diu.top10.compl -text "   Type of ALU compare to implement"
488
 
489
 pack .diu.top2.flashl .diu.top3.addcl .diu.top4.cyl .diu.top5.fml .diu.top6.divl .diu.top7.rotl .diu.top8.mull .diu.top9.lpmull .diu.top10.compl -side left
490
 
491
 
492
 frame .diu.top11.left -relief raised -bd 1 -relief flat
493
 frame .diu.top11.right -relief raised -bd 1 -relief flat
494
 
495
 pack .diu.top11.left -side left -fill both
496
 pack .diu.top11.right -side right -fill both
497
 
498
 button .diu.top11.left.nextb -text "Next" -command { confIC }
499
 button .diu.top11.right.exitb -text "Exit" -command { destroy .diu }
500
 
501
 pack .diu.top11.left.nextb -side top -padx 10m -pady 5m -fill x
502
 pack .diu.top11.right.exitb -side top  -padx 10m -pady 5m -fill x
503
 
504
}
505
 
506
 
507
proc confPM { } {
508
 
509
 destroy .dpm
510
 destroy .ddu
511
 
512
 toplevel .dpm -class Dialog
513
 wm title .dpm "Power Management"
514
 wm iconname .dpm Dialog
515
 
516
 frame .dpm.top -relief raised -bd 1 -relief flat
517
 frame .dpm.top2 -relief raised -bd 1 -relief groove
518
 frame .dpm.top3 -relief raised -bd 1 -relief groove
519
 frame .dpm.top4 -relief raised -bd 1 -relief groove
520
 frame .dpm.top5 -relief raised -bd 1 -relief groove
521
 frame .dpm.top6 -relief raised -bd 1 -relief groove
522
 
523
 pack .dpm.top -side top -fill both
524
 pack .dpm.top2 -side top -fill both
525
 pack .dpm.top3 -side top -fill both
526
 pack .dpm.top4 -side top -fill both
527
 pack .dpm.top5 -side top -fill both
528
 pack .dpm.top6 -side top -fill both
529
 
530
 label .dpm.top.opl -text "OpenRISC 1200 Power Management Configuration" -relief raised
531
 pack .dpm.top.opl -side top -pady 5m  -padx 10m
532
 
533
 radiobutton .dpm.top2.imply -text y -variable PM_IMPLEMENTED -value 1
534
 radiobutton .dpm.top2.impln -text n -variable PM_IMPLEMENTED -value 0
535
 pack .dpm.top2.imply .dpm.top2.impln -side left
536
 
537
 
538
 radiobutton .dpm.top3.ready -text y -variable PM_READREGS -value 1
539
 radiobutton .dpm.top3.readn -text n -variable PM_READREGS -value 0
540
 pack .dpm.top3.ready .dpm.top3.readn -side left
541
 
542
 radiobutton .dpm.top4.unusedy -text y -variable PM_UNUSED_ZERO -value 1
543
 radiobutton .dpm.top4.unusedn -text n -variable PM_UNUSED_ZERO -value 0
544
 pack .dpm.top4.unusedy .dpm.top4.unusedn -side left
545
 
546
 radiobutton .dpm.top5.pary -text y -variable PM_PARTIAL_DECODING -value 1
547
 radiobutton .dpm.top5.parn -text n -variable PM_PARTIAL_DECODING -value 0
548
 pack .dpm.top5.pary .dpm.top5.parn -side left
549
 
550
 
551
 label .dpm.top2.impll -text "   Power Management Unit Implemented"
552
 label .dpm.top3.readl -text "   Read PMR is allowed"
553
 label .dpm.top4.unusedl -text "   Unused PMR bits should be zero"
554
 label .dpm.top5.parl -text "   PMR can be read/written at any address inside PM group"
555
 
556
 pack .dpm.top2.impll  -side left
557
 pack .dpm.top3.readl  -side left
558
 pack .dpm.top4.unusedl  -side left
559
 pack .dpm.top5.parl  -side left
560
 
561
 frame .dpm.top6.left -relief raised -bd 1 -relief flat
562
 frame .dpm.top6.right -relief raised -bd 1 -relief flat
563
 
564
 pack .dpm.top6.left -side left -fill both
565
 pack .dpm.top6.right -side right -fill both
566
 
567
 button .dpm.top6.left.nextb -text "Next" -command { confPIC }
568
 button .dpm.top6.right.exitb -text "Exit" -command { destroy .dpm }
569
 
570
 pack .dpm.top6.left.nextb -side top -padx 10m -pady 5m -fill x
571
 pack .dpm.top6.right.exitb -side top  -padx 10m -pady 5m -fill x
572
 
573
}
574
 
575
proc confDU { } {
576
 
577
 global ASIC
578
 global targetFPGA
579
 
580
 
581
 destroy .dmu
582
 destroy .ddu
583
 
584
 toplevel .ddu -class Dialog
585
 wm title .ddu "Debug Unit"
586
 wm iconname .ddu Dialog
587
 
588
 frame .ddu.top -relief raised -bd 1 -relief flat
589
 frame .ddu.top2 -relief raised -bd 1 -relief groove
590
 frame .ddu.top3 -relief raised -bd 1 -relief groove
591
 frame .ddu.top4 -relief raised -bd 1 -relief groove
592
 frame .ddu.top5 -relief raised -bd 1 -relief groove
593
 frame .ddu.top6 -relief raised -bd 1 -relief groove
594
 frame .ddu.top7 -relief raised -bd 1 -relief groove
595
 frame .ddu.top8 -relief raised -bd 1 -relief groove
596
 
597
 pack .ddu.top -side top -fill both
598
 pack .ddu.top2 -side top -fill both
599
 pack .ddu.top3 -side top -fill both
600
 pack .ddu.top4 -side top -fill both
601
 pack .ddu.top5 -side top -fill both
602
 pack .ddu.top6 -side top -fill both
603
 pack .ddu.top7 -side top -fill both
604
 pack .ddu.top8 -side top -fill both
605
 
606
 label .ddu.top.opl -text "OpenRISC 1200 Debug Unit Configuration" -relief raised
607
 pack .ddu.top.opl -side top -pady 5m  -padx 10m
608
 
609
 radiobutton .ddu.top2.imply -text y -variable DU_IMPLEMENTED -value 1
610
 radiobutton .ddu.top2.impln -text n -variable DU_IMPLEMENTED -value 0
611
 pack .ddu.top2.imply .ddu.top2.impln -side left
612
 
613
 
614
 radiobutton .ddu.top3.hwby -text y -variable DU_HWBKPTS -value 1
615
 radiobutton .ddu.top3.hwbn -text n -variable DU_HWBKPTS -value 0
616
 pack .ddu.top3.hwby .ddu.top3.hwbn -side left
617
 
618
 
619
 #Trace buffer option only if Virtex FPGA selected
620
 
621
 if { $ASIC==0 && ( $targetFPGA=="XILINX_RAMB4" || $targetFPGA=="XILINX_RAM32x1D" ) } {
622
   radiobutton .ddu.top4.tby -text y -variable DU_TB_IMPLEMENTED -value 1
623
   radiobutton .ddu.top4.tbn -text n -variable DU_TB_IMPLEMENTED -value 0
624
   pack .ddu.top4.tby .ddu.top4.tbn -side left
625
 
626
   label .ddu.top4.bufl -text "   Trace Buffer implemented (Only for Xilinx FPGA)"
627
   pack .ddu.top4.bufl  -side left
628
 } else {
629
   set DU_TB_IMPLEMENTED 0
630
 }
631
 
632
 radiobutton .ddu.top5.ready -text y -variable DU_READREGS -value 1
633
 radiobutton .ddu.top5.readn -text n -variable DU_READREGS -value 0
634
 pack .ddu.top5.ready .ddu.top5.readn -side left
635
 
636
 radiobutton .ddu.top6.unusedy -text y -variable DU_UNUSED_ZERO -value 1
637
 radiobutton .ddu.top6.unusedn -text n -variable DU_UNUSED_ZERO -value 0
638
 pack .ddu.top6.unusedy .ddu.top6.unusedn -side left
639
 
640
 radiobutton .ddu.top7.ifstaty -text y -variable DU_STATUS_UNIMPLEMENTED -value 1
641
 radiobutton .ddu.top7.ifstatn -text n -variable DU_STATUS_UNIMPLEMENTED -value 0
642
 pack .ddu.top7.ifstaty .ddu.top7.ifstatn -side left
643
 
644
 
645
 label .ddu.top2.impll -text "   Debug Unit Implemented"
646
 label .ddu.top3.hwbl -text "   Hardware breakpoints implemented"
647
 label .ddu.top5.readl -text "   Read DU registers is allowed"
648
 label .ddu.top6.unusedl -text "   Unused DU registers bits should be zero"
649
 label .ddu.top7.ifstatl -text "   IF/LSU status is not needed by devel I/F"
650
 
651
 pack .ddu.top2.impll  -side left
652
 pack .ddu.top3.hwbl  -side left
653
 pack .ddu.top5.readl  -side left
654
 pack .ddu.top6.unusedl  -side left
655
 pack .ddu.top7.ifstatl  -side left
656
 
657
 
658
 frame .ddu.top8.left -relief raised -bd 1 -relief flat
659
 frame .ddu.top8.right -relief raised -bd 1 -relief flat
660
 
661
 pack .ddu.top8.left -side left -fill both
662
 pack .ddu.top8.right -side right -fill both
663
 
664
 button .ddu.top8.left.nextb -text "Next" -command { confPM }
665
 button .ddu.top8.right.exitb -text "Exit" -command { destroy .ddu }
666
 
667
 pack .ddu.top8.left.nextb -side top -padx 10m -pady 5m -fill x
668
 pack .ddu.top8.right.exitb -side top  -padx 10m -pady 5m -fill x
669
 
670
}
671
 
672
 
673
proc confPIC { } {
674
 
675
 destroy .dpic
676
 destroy .dpm
677
 
678
 
679
 toplevel .dpic -class Dialog
680
 wm title .dpic "PIC"
681
 wm iconname .dpic Dialog
682
 
683
 frame .dpic.top -relief raised -bd 1 -relief flat
684
 frame .dpic.top2 -relief raised -bd 1 -relief groove
685
 frame .dpic.top3 -relief raised -bd 1 -relief groove
686
 frame .dpic.top4 -relief raised -bd 1 -relief groove
687
 frame .dpic.top5 -relief raised -bd 1 -relief groove
688
 frame .dpic.top6 -relief raised -bd 1 -relief groove
689
 frame .dpic.top7 -relief raised -bd 1 -relief groove
690
 frame .dpic.top8 -relief raised -bd 1 -relief groove
691
 
692
 pack .dpic.top -side top -fill both
693
 pack .dpic.top2 -side top -fill both
694
 pack .dpic.top3 -side top -fill both
695
 pack .dpic.top4 -side top -fill both
696
 pack .dpic.top5 -side top -fill both
697
 pack .dpic.top6 -side top -fill both
698
 pack .dpic.top7 -side top -fill both
699
 pack .dpic.top8 -side top -fill both
700
 
701
 
702
 label .dpic.top.opl -text "OpenRISC 1200 PIC Configuration" -relief raised
703
 pack .dpic.top.opl -side top -pady 5m  -padx 10m
704
 
705
 radiobutton .dpic.top2.imply -text y -variable PIC_IMPLEMENTED -value 1
706
 radiobutton .dpic.top2.impln -text n -variable PIC_IMPLEMENTED -value 0
707
 pack .dpic.top2.imply .dpic.top2.impln -side left
708
 
709
 entry .dpic.top3.entry1 -width 3 -relief sunken -bd 2 -textvariable PIC_INTS
710
 pack .dpic.top3.entry1 -side left
711
 
712
 radiobutton .dpic.top4.ready -text y -variable PIC_READREGS -value 1
713
 radiobutton .dpic.top4.readn -text n -variable PIC_READREGS -value 0
714
 pack .dpic.top4.ready .dpic.top4.readn -side left
715
 
716
 radiobutton .dpic.top5.unusedy -text y -variable PIC_UNUSED_ZERO -value 1
717
 radiobutton .dpic.top5.unusedn -text n -variable PIC_UNUSED_ZERO -value 0
718
 pack .dpic.top5.unusedy .dpic.top5.unusedn -side left
719
 
720
 radiobutton .dpic.top6.mry -text y -variable PIC_PICMR -value 1
721
 radiobutton .dpic.top6.mrn -text n -variable PIC_PICMR -value 0
722
 pack .dpic.top6.mry .dpic.top6.mrn -side left
723
 
724
 radiobutton .dpic.top7.sry -text y -variable PIC_PICSR -value 1
725
 radiobutton .dpic.top7.srn -text n -variable PIC_PICSR -value 0
726
 pack .dpic.top7.sry .dpic.top7.srn -side left
727
 
728
 
729
 
730
 label .dpic.top2.impll -text "   PIC Implemented"
731
 label .dpic.top3.numl -text "         Number of interrupt inputs (2-31)"
732
 label .dpic.top4.unusedl -text "   Read PIC registers is allowed"
733
 label .dpic.top5.parl -text "   Unused PIC bits should be zero"
734
 label .dpic.top6.mrl -text "   Implement PICMR register"
735
 label .dpic.top7.srl -text "   Implement PICSR register"
736
 
737
 pack .dpic.top2.impll  -side left
738
 pack .dpic.top3.numl  -side left
739
 pack .dpic.top4.unusedl  -side left
740
 pack .dpic.top5.parl  -side left
741
 pack .dpic.top6.mrl  -side left
742
 pack .dpic.top7.srl  -side left
743
 
744
 frame .dpic.top8.left -relief raised -bd 1 -relief flat
745
 frame .dpic.top8.right -relief raised -bd 1 -relief flat
746
 
747
 pack .dpic.top8.left -side left -fill both
748
 pack .dpic.top8.right -side right -fill both
749
 
750
 button .dpic.top8.left.nextb -text "Next" -command { confTT }
751
 button .dpic.top8.right.exitb -text "Exit" -command { destroy .dpic }
752
 
753
 pack .dpic.top8.left.nextb -side top -padx 10m -pady 5m -fill x
754
 pack .dpic.top8.right.exitb -side top  -padx 10m -pady 5m -fill x
755
 
756
}
757
 
758
 
759
proc confTT { } {
760
 
761
 destroy .dpic
762
 destroy .dtt
763
 
764
 toplevel .dtt -class Dialog
765
 wm title .dtt "Tick Timer"
766
 wm iconname .dtt Dialog
767
 
768
 frame .dtt.top -relief raised -bd 1 -relief flat
769
 frame .dtt.top2 -relief raised -bd 1 -relief groove
770
 frame .dtt.top3 -relief raised -bd 1 -relief groove
771
 frame .dtt.top4 -relief raised -bd 1 -relief groove
772
 frame .dtt.top5 -relief raised -bd 1 -relief groove
773
 frame .dtt.top6 -relief raised -bd 1 -relief groove
774
 
775
 pack .dtt.top -side top -fill both
776
 pack .dtt.top2 -side top -fill both
777
 pack .dtt.top3 -side top -fill both
778
 pack .dtt.top4 -side top -fill both
779
 pack .dtt.top5 -side top -fill both
780
 pack .dtt.top6 -side top -fill both
781
 
782
 
783
 label .dtt.top.opl -text "OpenRISC 1200 Tick Timer Configuration" -relief raised
784
 pack .dtt.top.opl -side top -pady 5m  -padx 10m
785
 
786
 radiobutton .dtt.top2.imply -text y -variable TT_IMPLEMENTED -value 1
787
 radiobutton .dtt.top2.impln -text n -variable TT_IMPLEMENTED -value 0
788
 pack .dtt.top2.imply .dtt.top2.impln -side left
789
 
790
 radiobutton .dtt.top3.mry -text y -variable TT_TTMR -value 1
791
 radiobutton .dtt.top3.mrn -text n -variable TT_TTMR -value 0
792
 pack .dtt.top3.mry .dtt.top3.mrn -side left
793
 
794
 radiobutton .dtt.top4.sry -text y -variable TT_TTSR -value 1
795
 radiobutton .dtt.top4.srn -text n -variable TT_TTSR -value 0
796
 pack .dtt.top4.sry .dtt.top4.srn -side left
797
 
798
 radiobutton .dtt.top5.ready -text y -variable TT_READREGS -value 1
799
 radiobutton .dtt.top5.readn -text n -variable TT_READREGS -value 0
800
 pack .dtt.top5.ready .dtt.top5.readn -side left
801
 
802
 
803
 
804
 label .dtt.top2.impll -text "   Tick Timer Implemented"
805
 label .dtt.top3.mrl -text "   Implement TTMR register"
806
 label .dtt.top4.srl -text "   Implement TTSR register"
807
 label .dtt.top5.readl -text "   Read TT registers is allowed"
808
 
809
 pack .dtt.top2.impll  -side left
810
 pack .dtt.top3.mrl  -side left
811
 pack .dtt.top4.srl  -side left
812
 pack .dtt.top5.readl  -side left
813
 
814
 
815
 frame .dtt.top6.left -relief raised -bd 1 -relief flat
816
 frame .dtt.top6.right -relief raised -bd 1 -relief flat
817
 
818
 pack .dtt.top6.left -side left -fill both
819
 pack .dtt.top6.right -side right -fill both
820
 
821
 button .dtt.top6.left.nextb -text "Next" -command { confQM }
822
 button .dtt.top6.right.exitb -text "Exit" -command { destroy .dtt }
823
 
824
 pack .dtt.top6.left.nextb -side top -padx 10m -pady 5m -fill x
825
 pack .dtt.top6.right.exitb -side top  -padx 10m -pady 5m -fill x
826
 
827
}
828
 
829
proc confIC { } {
830
 
831
 global IC_WAYS
832
 global IC_SIZE
833
 global ICLS
834
 
835
 destroy .diu
836
 destroy .dic
837
 
838
 toplevel .dic -class Dialog
839
 wm title .dic "Instruction Cache"
840
 wm iconname .dic Dialog
841
 
842
 frame .dic.top -relief raised -bd 1 -relief flat
843
 frame .dic.top2 -relief raised -bd 1 -relief groove
844
 frame .dic.top3 -relief raised -bd 1 -relief groove
845
 frame .dic.top4 -relief raised -bd 1 -relief groove
846
 frame .dic.top5 -relief raised -bd 1 -relief groove
847
 frame .dic.top6 -relief raised -bd 1 -relief groove
848
 
849
 pack .dic.top -side top -fill both
850
 pack .dic.top2 -side top -fill both
851
 pack .dic.top3 -side top -fill both
852
 pack .dic.top4 -side top -fill both
853
 pack .dic.top5 -side top -fill both
854
 pack .dic.top6 -side top -fill both
855
 
856
 
857
 label .dic.top.opl -text "OpenRISC 1200 Instruction Cache Configuration" -relief raised
858
 pack .dic.top.opl -side top -pady 5m  -padx 10m
859
 
860
 radiobutton .dic.top2.imply -text y -variable NO_IC -value 0
861
 radiobutton .dic.top2.impln -text n -variable NO_IC -value 1
862
 pack .dic.top2.imply .dic.top2.impln -side left
863
 
864
 menubutton .dic.top3.ways -text Ways -menu .dic.top3.ways.menu -relief raised
865
 pack .dic.top3.ways -side left -fill both
866
 menu .dic.top3.ways.menu
867
 .dic.top3.ways.menu add radiobutton -label "1" -variable IC_WAYS -value 1
868
 tk_menuBar .dic.top3.ways
869
 
870
 menubutton .dic.top4.size -text Size -menu .dic.top4.size.menu -relief raised
871
 pack .dic.top4.size -side left -fill both
872
 menu .dic.top4.size.menu
873
 .dic.top4.size.menu add radiobutton -label "512B" -variable IC_SIZE -value 512B
874
 .dic.top4.size.menu add radiobutton -label "4KB" -variable IC_SIZE -value 4KB
875
 .dic.top4.size.menu add radiobutton -label "8KB" -variable IC_SIZE -value 8KB
876
 
877
 tk_menuBar .dic.top4.size
878
 
879
 menubutton .dic.top5.lcls -text "Line Size" -menu .dic.top5.lcls.menu -relief raised
880
 pack .dic.top5.lcls -side left -fill both
881
 menu .dic.top5.lcls.menu
882
 .dic.top5.lcls.menu add radiobutton -label "8" -variable ICLS -value 8
883
 .dic.top5.lcls.menu add radiobutton -label "16" -variable ICLS -value 16
884
 
885
 tk_menuBar .dic.top5.lcls
886
 
887
 
888
 
889
 
890
 label .dic.top2.impll -text "   Instruction Cache Implemented"
891
 label .dic.top3.wayl -text  "   Instruction Cache Ways"
892
 label .dic.top4.sizel -text "   Instruction Cache Size"
893
 label .dic.top5.lclsl -text "   Instruction Cache Line Size in bytes"
894
 
895
 pack .dic.top2.impll  -side left
896
 pack .dic.top3.wayl  -side left
897
 pack .dic.top4.sizel  -side left
898
 pack .dic.top5.lclsl  -side left
899
 
900
 frame .dic.top6.left -relief raised -bd 1 -relief flat
901
 frame .dic.top6.right -relief raised -bd 1 -relief flat
902
 
903
 pack .dic.top6.left -side left -fill both
904
 pack .dic.top6.right -side right -fill both
905
 
906
 button .dic.top6.left.nextb -text "Next" -command { confDC }
907
 button .dic.top6.right.exitb -text "Exit" -command { destroy .dic }
908
 
909
 pack .dic.top6.left.nextb -side top -padx 10m -pady 5m -fill x
910
 pack .dic.top6.right.exitb -side top  -padx 10m -pady 5m -fill x
911
 
912
}
913
 
914
proc confDC { } {
915
 
916
 global DC_WAYS
917
 global DC_SIZE
918
 global DCLS
919
 
920
 destroy .ddc
921
 destroy .dic
922
 
923
 toplevel .ddc -class Dialog
924
 wm title .ddc "Data Cache"
925
 wm iconname .ddc Dialog
926
 
927
 frame .ddc.top -relief raised -bd 1 -relief flat
928
 frame .ddc.top2 -relief raised -bd 1 -relief groove
929
 frame .ddc.top3 -relief raised -bd 1 -relief groove
930
 frame .ddc.top4 -relief raised -bd 1 -relief groove
931
 frame .ddc.top5 -relief raised -bd 1 -relief groove
932
 frame .ddc.top6 -relief raised -bd 1 -relief groove
933
 frame .ddc.top7 -relief raised -bd 1 -relief groove
934
 frame .ddc.top8 -relief raised -bd 1 -relief groove
935
 frame .ddc.top9 -relief raised -bd 1 -relief groove
936
 frame .ddc.top10 -relief raised -bd 1 -relief groove
937
 
938
 
939
 pack .ddc.top -side top -fill both
940
 pack .ddc.top2 -side top -fill both
941
 pack .ddc.top3 -side top -fill both
942
 pack .ddc.top4 -side top -fill both
943
 pack .ddc.top5 -side top -fill both
944
 pack .ddc.top6 -side top -fill both
945
 pack .ddc.top7 -side top -fill both
946
 pack .ddc.top8 -side top -fill both
947
 pack .ddc.top9 -side top -fill both
948
 pack .ddc.top10 -side top -fill both
949
 
950
 label .ddc.top.opl -text "OpenRISC 1200 Data Cache Configuration" -relief raised
951
 pack .ddc.top.opl -side top -pady 5m  -padx 10m
952
 
953
 radiobutton .ddc.top2.imply -text y -variable NO_DC -value 0
954
 radiobutton .ddc.top2.impln -text n -variable NO_DC -value 1
955
 pack .ddc.top2.imply .ddc.top2.impln -side left
956
 
957
 menubutton .ddc.top3.ways -text Ways -menu .ddc.top3.ways.menu -relief raised
958
 pack .ddc.top3.ways -side left -fill both
959
 menu .ddc.top3.ways.menu
960
 .ddc.top3.ways.menu add radiobutton -label "1" -variable DC_WAYS -value 1
961
 tk_menuBar .ddc.top3.ways
962
 
963
 menubutton .ddc.top4.size -text Size -menu .ddc.top4.size.menu -relief raised
964
 pack .ddc.top4.size -side left -fill both
965
 menu .ddc.top4.size.menu
966
 .ddc.top4.size.menu add radiobutton -label "4KB" -variable DC_SIZE -value 4KB
967
 .ddc.top4.size.menu add radiobutton -label "8KB" -variable DC_SIZE -value 8KB
968
 
969
 tk_menuBar .ddc.top4.size
970
 
971
 menubutton .ddc.top5.lcls -text "Line Size" -menu .ddc.top5.lcls.menu -relief raised
972
 pack .ddc.top5.lcls -side left -fill both
973
 menu .ddc.top5.lcls.menu
974
 .ddc.top5.lcls.menu add radiobutton -label "8" -variable DCLS -value 8
975
 .ddc.top5.lcls.menu add radiobutton -label "16" -variable DCLS -value 16
976
 
977
 tk_menuBar .ddc.top5.lcls
978
 
979
 label .ddc.top6.opl -text "OpenRISC 1200 Store Buffer Configuration" -relief raised
980
 pack .ddc.top6.opl -side top -pady 5m  -padx 10m
981
 
982
 radiobutton .ddc.top7.imply -text y -variable SB_IMPLEMENTED -value 1
983
 radiobutton .ddc.top7.impln -text n -variable SB_IMPLEMENTED -value 0
984
 pack .ddc.top7.imply .ddc.top7.impln -side left
985
 
986
 menubutton .ddc.top8.sbs -text "Store Buffer Size" -menu .ddc.top8.sbs.menu -relief raised
987
 pack .ddc.top8.sbs -side left -fill both
988
 menu .ddc.top8.sbs.menu
989
 .ddc.top8.sbs.menu add radiobutton -label "4" -variable SB_ENTRIES -value 4 -command { set SB_LOG 2 }
990
 .ddc.top8.sbs.menu add radiobutton -label "8" -variable SB_ENTRIES -value 8 -command { set SB_LOG 3 }
991
 
992
 tk_menuBar .ddc.top8.sbs
993
 
994
 
995
 
996
 label .ddc.top2.impll -text "   Data Cache Implemented"
997
 label .ddc.top3.wayl -text  "   Data Cache Ways"
998
 label .ddc.top4.sizel -text "   Data Cache Size"
999
 label .ddc.top5.lclsl -text "   Data Cache Line Size in bytes"
1000
 label .ddc.top7.impl -text  "   Enable Store Buffer"
1001
 label .ddc.top8.sbel -text  "   Store Buffer Entries"
1002
 
1003
 pack .ddc.top2.impll  -side left
1004
 pack .ddc.top3.wayl  -side left
1005
 pack .ddc.top4.sizel  -side left
1006
 pack .ddc.top5.lclsl  -side left
1007
 pack .ddc.top7.impl  -side left
1008
 pack .ddc.top8.sbel  -side left
1009
 
1010
 frame .ddc.top10.left -relief raised -bd 1 -relief flat
1011
 frame .ddc.top10.right -relief raised -bd 1 -relief flat
1012
 
1013
 pack .ddc.top10.left -side left -fill both
1014
 pack .ddc.top10.right -side right -fill both
1015
 
1016
 button .ddc.top10.left.nextb -text "Next" -command { confMMU }
1017
 button .ddc.top10.right.exitb -text "Exit" -command { destroy .ddc }
1018
 
1019
 pack .ddc.top10.left.nextb -side top -padx 10m -pady 5m -fill x
1020
 pack .ddc.top10.right.exitb -side top  -padx 10m -pady 5m -fill x
1021
 
1022
}
1023
 
1024
proc confQM { } {
1025
 
1026
 destroy .dqm
1027
 destroy .dtt
1028
 
1029
 toplevel .dqm -class Dialog
1030
 wm title .dqm "Quick Embedded Memory"
1031
 wm iconname .dqm Dialog
1032
 
1033
 frame .dqm.top -relief raised -bd 1 -relief flat
1034
 frame .dqm.top2 -relief raised -bd 1 -relief groove
1035
 frame .dqm.top3 -relief raised -bd 1 -relief groove
1036
 frame .dqm.top4 -relief raised -bd 1 -relief groove
1037
 frame .dqm.top6 -relief raised -bd 1 -relief groove
1038
 
1039
 pack .dqm.top -side top -fill both
1040
 pack .dqm.top2 -side top -fill both
1041
 pack .dqm.top3 -side top -fill both
1042
 pack .dqm.top4 -side top -fill both
1043
 pack .dqm.top6 -side top -fill both
1044
 
1045
 
1046
 label .dqm.top.opl -text "OpenRISC 1200 Quick Embedded Memory Configuration" -relief raised
1047
 pack .dqm.top.opl -side top -pady 5m  -padx 10m
1048
 
1049
 radiobutton .dqm.top2.imply -text y -variable QMEM_IMPLEMENTED -value 1
1050
 radiobutton .dqm.top2.impln -text n -variable QMEM_IMPLEMENTED -value 0
1051
 pack .dqm.top2.imply .dqm.top2.impln -side left
1052
 
1053
 radiobutton .dqm.top3.sely -text y -variable QMEM_BSEL -value 1
1054
 radiobutton .dqm.top3.seln -text n -variable QMEM_BSEL -value 0
1055
 pack .dqm.top3.sely .dqm.top3.seln -side left
1056
 
1057
 radiobutton .dqm.top4.acky -text y -variable QMEM_ACK -value 1
1058
 radiobutton .dqm.top4.ackn -text n -variable QMEM_ACK -value 0
1059
 pack .dqm.top4.acky .dqm.top4.ackn -side left
1060
 
1061
 
1062
 label .dqm.top2.impll -text "   Implement Quick Embedded Memory"
1063
 label .dqm.top3.sell -text "   Enable qmem_sel* ports"
1064
 label .dqm.top4.ackl -text "   Enable qmem_ack port"
1065
 
1066
 pack .dqm.top2.impll  -side left
1067
 pack .dqm.top3.sell  -side left
1068
 pack .dqm.top4.ackl  -side left
1069
 
1070
 frame .dqm.top6.left -relief raised -bd 1 -relief flat
1071
 frame .dqm.top6.right -relief raised -bd 1 -relief flat
1072
 
1073
 pack .dqm.top6.left -side left -fill both
1074
 pack .dqm.top6.right -side right -fill both
1075
 
1076
 button .dqm.top6.left.nextb -text "Next" -command { confMISC }
1077
 button .dqm.top6.right.exitb -text "Exit" -command { destroy .dqm }
1078
 
1079
 pack .dqm.top6.left.nextb -side top -padx 10m -pady 5m -fill x
1080
 pack .dqm.top6.right.exitb -side top  -padx 10m -pady 5m -fill x
1081
 
1082
}
1083
 
1084
proc confMMU { } {
1085
 
1086
 destroy .dmu
1087
 destroy .ddc
1088
 
1089
 toplevel .dmu -class Dialog
1090
 wm title .dmu "MMU"
1091
 wm iconname .dmu Dialog
1092
 
1093
 frame .dmu.top -relief raised -bd 1 -relief flat
1094
 frame .dmu.top2 -relief raised -bd 1 -relief groove
1095
 frame .dmu.top3 -relief raised -bd 1 -relief groove
1096
 frame .dmu.top6 -relief raised -bd 1 -relief groove
1097
 
1098
 pack .dmu.top -side top -fill both
1099
 pack .dmu.top2 -side top -fill both
1100
 pack .dmu.top3 -side top -fill both
1101
 pack .dmu.top6 -side top -fill both
1102
 
1103
 
1104
 label .dmu.top.opl -text "OpenRISC 1200 MMU Configuration" -relief raised
1105
 pack .dmu.top.opl -side top -pady 5m  -padx 10m
1106
 
1107
 radiobutton .dmu.top2.imply -text y -variable NO_IMMU -value 0
1108
 radiobutton .dmu.top2.impln -text n -variable NO_IMMU -value 1
1109
 pack .dmu.top2.imply .dmu.top2.impln -side left
1110
 
1111
 
1112
 radiobutton .dmu.top3.imply -text y -variable NO_DMMU -value 0
1113
 radiobutton .dmu.top3.impln -text n -variable NO_DMMU -value 1
1114
 pack .dmu.top3.imply .dmu.top3.impln -side left
1115
 
1116
 
1117
 label .dmu.top2.impll -text "   Implement Instruction MMU"
1118
 label .dmu.top3.impll -text "   Implement Data MMU"
1119
 
1120
 pack .dmu.top2.impll  -side left
1121
 pack .dmu.top3.impll  -side left
1122
 
1123
 
1124
 frame .dmu.top6.left -relief raised -bd 1 -relief flat
1125
 frame .dmu.top6.right -relief raised -bd 1 -relief flat
1126
 
1127
 pack .dmu.top6.left -side left -fill both
1128
 pack .dmu.top6.right -side right -fill both
1129
 
1130
 button .dmu.top6.left.nextb -text "Next" -command { confDU }
1131
 button .dmu.top6.right.exitb -text "Exit" -command { destroy .dmu }
1132
 
1133
 pack .dmu.top6.left.nextb -side top -padx 10m -pady 5m -fill x
1134
 pack .dmu.top6.right.exitb -side top  -padx 10m -pady 5m -fill x
1135
 
1136
}
1137
 
1138
proc confMISC { } {
1139
 
1140
 destroy .dmi
1141
 destroy .dqm
1142
 
1143
 toplevel .dmi -class Dialog
1144
 wm title .dmi "Misc"
1145
 wm iconname .dmi Dialog
1146
 
1147
 frame .dmi.top -relief raised -bd 1 -relief flat
1148
 frame .dmi.top2 -relief raised -bd 1 -relief groove
1149
 frame .dmi.top3 -relief raised -bd 1 -relief groove
1150
 frame .dmi.top4 -relief raised -bd 1 -relief groove
1151
 frame .dmi.top5 -relief raised -bd 1 -relief groove
1152
 frame .dmi.top6 -relief raised -bd 1 -relief groove
1153
 
1154
 pack .dmi.top -side top -fill both
1155
 pack .dmi.top2 -side top -fill both
1156
 pack .dmi.top3 -side top -fill both
1157
 pack .dmi.top4 -side top -fill both
1158
 pack .dmi.top5 -side top -fill both
1159
 pack .dmi.top6 -side top -fill both
1160
 
1161
 
1162
 label .dmi.top.opl -text "OpenRISC 1200 Miscellaneous Configuration" -relief raised
1163
 pack .dmi.top.opl -side top -pady 5m  -padx 10m
1164
 
1165
 radiobutton .dmi.top2.imply -text y -variable MAC_IMPLEMENTED -value 1
1166
 radiobutton .dmi.top2.impln -text n -variable MAC_IMPLEMENTED -value 0
1167
 pack .dmi.top2.imply .dmi.top2.impln -side left
1168
 
1169
 radiobutton .dmi.top3.macwey -text y -variable MAC_SPR_WE -value 1
1170
 radiobutton .dmi.top3.macwen -text n -variable MAC_SPR_WE -value 0
1171
 pack .dmi.top3.macwey .dmi.top3.macwen -side left
1172
 
1173
 radiobutton .dmi.top4.imply -text y -variable CFGR_IMPLEMENTED -value 1
1174
 radiobutton .dmi.top4.impln -text n -variable CFGR_IMPLEMENTED -value 0
1175
 pack .dmi.top4.imply .dmi.top4.impln -side left
1176
 
1177
 radiobutton .dmi.top5.sysy -text y -variable SYS_FULL_DECODE -value 1
1178
 radiobutton .dmi.top5.sysn -text n -variable SYS_FULL_DECODE -value 0
1179
 pack .dmi.top5.sysy .dmi.top5.sysn -side left
1180
 
1181
 
1182
 label .dmi.top2.impll -text "   Implement Multiply and Accumulate (MAC) Unit"
1183
 label .dmi.top3.macwel -text "   MACLO/MACHI registers are writable"
1184
 label .dmi.top4.impll -text "   Implement configuration registers"
1185
 label .dmi.top5.sysl -text "   Full address decode inside SYS group"
1186
 
1187
 pack .dmi.top2.impll  -side left
1188
 pack .dmi.top3.macwel  -side left
1189
 pack .dmi.top4.impll  -side left
1190
 pack .dmi.top5.sysl  -side left
1191
 
1192
 frame .dmi.top6.left -relief raised -bd 1 -relief flat
1193
 frame .dmi.top6.right -relief raised -bd 1 -relief flat
1194
 
1195
 pack .dmi.top6.left -side left -fill both
1196
 pack .dmi.top6.right -side right -fill both
1197
 
1198
 button .dmi.top6.left.nextb -text "Next" -command { confIU }
1199
 button .dmi.top6.right.exitb -text "Exit" -command { destroy .dmi }
1200
 
1201
 pack .dmi.top6.left.nextb -side top -padx 10m -pady 5m -fill x
1202
 pack .dmi.top6.right.exitb -side top  -padx 10m -pady 5m -fill x
1203
 
1204
}
1205
 
1206
 
1207
proc saveconfdialog { } {
1208
 
1209
 destroy .dsaveconf
1210
 
1211
 toplevel .dsaveconf -class Dialog
1212
 wm title .dsaveconf "Save Configuration"
1213
 wm iconname .dsaveconf Dialog
1214
 frame .dsaveconf.top -relief raised -bd 1
1215
 pack .dsaveconf.top -side top -fill both
1216
 frame .dsaveconf.bot -relief raised -bd 1
1217
 pack .dsaveconf.bot -side top -fill both
1218
 
1219
 
1220
 label .dsaveconf.top.fn -text "Enter Filename" -relief raised
1221
 pack .dsaveconf.top.fn -side left -pady 5m  -padx 10m
1222
 
1223
 entry .dsaveconf.top.entry1 -width 20 -relief sunken -bd 2 -textvariable savefilename
1224
 pack .dsaveconf.top.entry1 -side left -pady 5m  -padx 10m
1225
 
1226
 frame .dsaveconf.bot.left -relief raised -bd 1 -relief flat
1227
 frame .dsaveconf.bot.right -relief raised -bd 1 -relief flat
1228
 
1229
 pack .dsaveconf.bot.left -side left -fill both
1230
 pack .dsaveconf.bot.right -side right -fill both
1231
 
1232
 button .dsaveconf.bot.left.okb -text "OK" -command { saveconf $savefilename }
1233
 button .dsaveconf.bot.right.cancelb -text "Cancel" -command { destroy .dsaveconf }
1234
 
1235
 pack .dsaveconf.bot.left.okb -side top -padx 10m -pady 5m -fill x
1236
 pack .dsaveconf.bot.right.cancelb -side top  -padx 10m -pady 5m -fill x
1237
 
1238
 
1239
}
1240
 
1241
proc saveconf { file } {
1242
 
1243
global ASIC
1244
global VCD_DUMP
1245
global VERBOSE
1246
global targetFPGA
1247
global targetASIC
1248
global ASIC_MULTP2_32X32
1249
global BIST
1250
global RF_RAM
1251
#Wishbone defines
1252
global REGISTERED_OUTPUTS
1253
global REGISTERED_INPUTS
1254
global NO_BURSTS
1255
global WB_RETRY
1256
global WB_CAB
1257
global WB_B3
1258
global CLKDIV2_SUPPORT
1259
global CLKDIV4_SUPPORT
1260
#Misc
1261
global ADDITIONAL_SYNOPSYS_DIRECTIVES
1262
global CASE_DEFAULT
1263
global IMPL_MEM2REG
1264
#IU defines
1265
global SR_EPH_DEF
1266
global IMPL_ADDC
1267
global IMPL_CY
1268
global ADDITIONAL_FLAG_MODIFIERS
1269
global IMPL_DIV
1270
global IMPL_ALU_ROTATE
1271
global MULT_IMPLEMENTED
1272
global LWPWR_MULT
1273
global ALU_COMP
1274
#PM defines
1275
global PM_IMPLEMENTED
1276
global PM_READREGS
1277
global PM_UNUSED_ZERO
1278
global PM_PARTIAL_DECODING
1279
#DU defines
1280
global DU_IMPLEMENTED
1281
global DU_HWBKPTS
1282
global DU_TB_IMPLEMENTED
1283
global DU_READREGS
1284
global DU_UNUSED_ZERO
1285
global DU_STATUS_UNIMPLEMENTED
1286
#PIC defines
1287
global PIC_IMPLEMENTED
1288
global PIC_READREGS
1289
global PIC_UNUSED_ZERO
1290
global PIC_PICMR
1291
global PIC_PICSR
1292
global PIC_INTS
1293
#TT defines
1294
global TT_IMPLEMENTED
1295
global TT_TTMR
1296
global TT_TTSR
1297
global TT_READREGS
1298
#IC CACHES
1299
global NO_IC
1300
global IC_WAYS
1301
global IC_SIZE
1302
global ICLS
1303
#DC defines
1304
global NO_DC
1305
global DC_WAYS
1306
global DC_SIZE
1307
global DCLS
1308
global SB_IMPLEMENTED
1309
global SB_ENTRIES
1310
global SB_LOG
1311
#MMU defines
1312
global NO_IMMU
1313
global NO_DMMU
1314
#QMEM defines
1315
global QMEM_IMPLEMENTED
1316
global QMEM_BSEL
1317
global QMEM_ACK
1318
#MISC defines
1319
global MAC_IMPLEMENTED
1320
global MAC_SPR_WE
1321
global CFGR_IMPLEMENTED
1322
global SYS_FULL_DECODE
1323
 
1324
 
1325
set errorno [catch { set f [open $file w] } errorname ]
1326
 
1327
if { $errorno != 0 } {
1328
 errorfile
1329
 return
1330
}
1331
 
1332
 
1333
puts $f $ASIC
1334
puts $f $VCD_DUMP
1335
puts $f $VERBOSE
1336
puts $f $targetFPGA
1337
puts $f $targetASIC
1338
puts $f $ASIC_MULTP2_32X32
1339
puts $f $BIST
1340
puts $f $RF_RAM
1341
 
1342
  #Wishbone defines
1343
puts $f $REGISTERED_OUTPUTS
1344
puts $f $REGISTERED_INPUTS
1345
puts $f $NO_BURSTS
1346
puts $f $WB_RETRY
1347
puts $f $WB_CAB
1348
puts $f $WB_B3
1349
puts $f $CLKDIV2_SUPPORT
1350
puts $f $CLKDIV4_SUPPORT
1351
 
1352
  #Misc
1353
puts $f $ADDITIONAL_SYNOPSYS_DIRECTIVES
1354
puts $f $CASE_DEFAULT
1355
puts $f $IMPL_MEM2REG
1356
 
1357
  #IU defines
1358
puts $f $SR_EPH_DEF
1359
puts $f $IMPL_ADDC
1360
puts $f $IMPL_CY
1361
puts $f $ADDITIONAL_FLAG_MODIFIERS
1362
puts $f $IMPL_DIV
1363
puts $f $IMPL_ALU_ROTATE
1364
puts $f $MULT_IMPLEMENTED
1365
puts $f $LWPWR_MULT
1366
puts $f $ALU_COMP
1367
 
1368
  #PM defines
1369
puts $f $PM_IMPLEMENTED
1370
puts $f $PM_READREGS
1371
puts $f $PM_UNUSED_ZERO
1372
puts $f $PM_PARTIAL_DECODING
1373
 
1374
  #DU defines
1375
puts $f $DU_IMPLEMENTED
1376
puts $f $DU_HWBKPTS
1377
puts $f $DU_TB_IMPLEMENTED
1378
puts $f $DU_READREGS
1379
puts $f $DU_UNUSED_ZERO
1380
puts $f $DU_STATUS_UNIMPLEMENTED
1381
 
1382
  #PIC defines
1383
puts $f $PIC_IMPLEMENTED
1384
puts $f $PIC_READREGS
1385
puts $f $PIC_UNUSED_ZERO
1386
puts $f $PIC_PICMR
1387
puts $f $PIC_PICSR
1388
puts $f $PIC_INTS
1389
 
1390
  #TT defines
1391
puts $f $TT_IMPLEMENTED
1392
puts $f $TT_TTMR
1393
puts $f $TT_TTSR
1394
puts $f $TT_READREGS
1395
 
1396
 
1397
  #IC CACHES
1398
puts $f $NO_IC
1399
puts $f $IC_WAYS
1400
puts $f $IC_SIZE
1401
puts $f $ICLS
1402
 
1403
  #DC defines
1404
puts $f $NO_DC
1405
puts $f $DC_WAYS
1406
puts $f $DC_SIZE
1407
puts $f $DCLS
1408
puts $f $SB_IMPLEMENTED
1409
puts $f $SB_ENTRIES
1410
puts $f $SB_LOG
1411
 
1412
  #MMU defines
1413
puts $f $NO_IMMU
1414
puts $f $NO_DMMU
1415
 
1416
  #QMEM defines
1417
puts $f $QMEM_IMPLEMENTED
1418
puts $f $QMEM_BSEL
1419
puts $f $QMEM_ACK
1420
 
1421
  #MISC defines
1422
puts $f $MAC_IMPLEMENTED
1423
puts $f $MAC_SPR_WE
1424
puts $f $CFGR_IMPLEMENTED
1425
puts $f $SYS_FULL_DECODE
1426
 
1427
 
1428
 
1429
close $f
1430
destroy .dsaveconf
1431
 
1432
}
1433
 
1434
proc loadconfdialog { } {
1435
 
1436
 destroy .dloadconf
1437
 
1438
 toplevel .dloadconf -class Dialog
1439
 wm title .dloadconf "Load Configuration"
1440
 wm iconname .dloadconf Dialog
1441
 frame .dloadconf.top -relief raised -bd 1
1442
 pack .dloadconf.top -side top -fill both
1443
 frame .dloadconf.bot -relief raised -bd 1
1444
 pack .dloadconf.bot -side top -fill both
1445
 
1446
 
1447
 label .dloadconf.top.fn -text "Enter Filename" -relief raised
1448
 pack .dloadconf.top.fn -side left -pady 5m  -padx 10m
1449
 
1450
 entry .dloadconf.top.entry1 -width 20 -relief sunken -bd 2 -textvariable loadfilename
1451
 pack .dloadconf.top.entry1 -side left -pady 5m  -padx 10m
1452
 
1453
 frame .dloadconf.bot.left -relief raised -bd 1 -relief flat
1454
 frame .dloadconf.bot.right -relief raised -bd 1 -relief flat
1455
 
1456
 pack .dloadconf.bot.left -side left -fill both
1457
 pack .dloadconf.bot.right -side right -fill both
1458
 
1459
 button .dloadconf.bot.left.okb -text "OK" -command { loadconf $loadfilename }
1460
 button .dloadconf.bot.right.cancelb -text "Cancel" -command { destroy .dloadconf }
1461
 
1462
 pack .dloadconf.bot.left.okb -side top -padx 10m -pady 5m -fill x
1463
 pack .dloadconf.bot.right.cancelb -side top  -padx 10m -pady 5m -fill x
1464
 
1465
 
1466
}
1467
 
1468
proc loadconf { file } {
1469
 
1470
global ASIC
1471
global VCD_DUMP
1472
global VERBOSE
1473
global targetFPGA
1474
global targetASIC
1475
global ASIC_MULTP2_32X32
1476
global BIST
1477
global RF_RAM
1478
#Wishbone defines
1479
global REGISTERED_OUTPUTS
1480
global REGISTERED_INPUTS
1481
global NO_BURSTS
1482
global WB_RETRY
1483
global WB_CAB
1484
global WB_B3
1485
global CLKDIV2_SUPPORT
1486
global CLKDIV4_SUPPORT
1487
#Misc
1488
global ADDITIONAL_SYNOPSYS_DIRECTIVES
1489
global CASE_DEFAULT
1490
global IMPL_MEM2REG
1491
#IU defines
1492
global SR_EPH_DEF
1493
global IMPL_ADDC
1494
global IMPL_CY
1495
global ADDITIONAL_FLAG_MODIFIERS
1496
global IMPL_DIV
1497
global IMPL_ALU_ROTATE
1498
global MULT_IMPLEMENTED
1499
global LWPWR_MULT
1500
global ALU_COMP
1501
#PM defines
1502
global PM_IMPLEMENTED
1503
global PM_READREGS
1504
global PM_UNUSED_ZERO
1505
global PM_PARTIAL_DECODING
1506
#DU defines
1507
global DU_IMPLEMENTED
1508
global DU_HWBKPTS
1509
global DU_TB_IMPLEMENTED
1510
global DU_READREGS
1511
global DU_UNUSED_ZERO
1512
global DU_STATUS_UNIMPLEMENTED
1513
#PIC defines
1514
global PIC_IMPLEMENTED
1515
global PIC_READREGS
1516
global PIC_UNUSED_ZERO
1517
global PIC_PICMR
1518
global PIC_PICSR
1519
global PIC_INTS
1520
#TT defines
1521
global TT_IMPLEMENTED
1522
global TT_TTMR
1523
global TT_TTSR
1524
global TT_READREGS
1525
#IC CACHES
1526
global NO_IC
1527
global IC_WAYS
1528
global IC_SIZE
1529
global ICLS
1530
#DC defines
1531
global NO_DC
1532
global DC_WAYS
1533
global DC_SIZE
1534
global DCLS
1535
global SB_IMPLEMENTED
1536
global SB_ENTRIES
1537
global SB_LOG
1538
#MMU defines
1539
global NO_IMMU
1540
global NO_DMMU
1541
#QMEM defines
1542
global QMEM_IMPLEMENTED
1543
global QMEM_BSEL
1544
global QMEM_ACK
1545
#MISC defines
1546
global MAC_IMPLEMENTED
1547
global MAC_SPR_WE
1548
global CFGR_IMPLEMENTED
1549
global SYS_FULL_DECODE
1550
 
1551
 
1552
set errorno [catch { set f [open $file r] } errorname ]
1553
 
1554
if { $errorno != 0 } {
1555
 errorfile
1556
 return
1557
}
1558
 
1559
 
1560
set ASIC [gets $f]
1561
set VCD_DUMP [gets $f]
1562
set VERBOSE [gets $f]
1563
set targetFPGA [gets $f]
1564
set targetASIC [gets $f]
1565
set ASIC_MULTP2_32X32 [gets $f]
1566
set BIST [gets $f]
1567
set RF_RAM [gets $f]
1568
 
1569
  #Wishbone defines
1570
set REGISTERED_OUTPUTS [gets $f]
1571
set REGISTERED_INPUTS [gets $f]
1572
set NO_BURSTS [gets $f]
1573
set WB_RETRY [gets $f]
1574
set WB_CAB [gets $f]
1575
set WB_B3 [gets $f]
1576
set CLKDIV2_SUPPORT [gets $f]
1577
set CLKDIV4_SUPPORT [gets $f]
1578
 
1579
  #Misc
1580
set ADDITIONAL_SYNOPSYS_DIRECTIVES [gets $f]
1581
set CASE_DEFAULT [gets $f]
1582
set IMPL_MEM2REG [gets $f]
1583
 
1584
  #IU defines
1585
set SR_EPH_DEF [gets $f]
1586
set IMPL_ADDC [gets $f]
1587
set IMPL_CY [gets $f]
1588
set ADDITIONAL_FLAG_MODIFIERS [gets $f]
1589
set IMPL_DIV [gets $f]
1590
set IMPL_ALU_ROTATE [gets $f]
1591
set MULT_IMPLEMENTED [gets $f]
1592
set LWPWR_MULT [gets $f]
1593
set ALU_COMP [gets $f]
1594
 
1595
  #PM defines
1596
set PM_IMPLEMENTED [gets $f]
1597
set PM_READREGS [gets $f]
1598
set PM_UNUSED_ZERO [gets $f]
1599
set PM_PARTIAL_DECODING [gets $f]
1600
 
1601
  #DU defines
1602
set DU_IMPLEMENTED [gets $f]
1603
set DU_HWBKPTS [gets $f]
1604
set DU_TB_IMPLEMENTED [gets $f]
1605
set DU_READREGS [gets $f]
1606
set DU_UNUSED_ZERO [gets $f]
1607
set DU_STATUS_UNIMPLEMENTED [gets $f]
1608
 
1609
  #PIC defines
1610
set PIC_IMPLEMENTED [gets $f]
1611
set PIC_READREGS [gets $f]
1612
set PIC_UNUSED_ZERO [gets $f]
1613
set PIC_PICMR [gets $f]
1614
set PIC_PICSR [gets $f]
1615
set PIC_INTS [gets $f]
1616
 
1617
  #TT defines
1618
set TT_IMPLEMENTED [gets $f]
1619
set TT_TTMR [gets $f]
1620
set TT_TTSR [gets $f]
1621
set TT_READREGS [gets $f]
1622
 
1623
 
1624
  #IC CACHES
1625
set NO_IC [gets $f]
1626
set IC_WAYS  [gets $f]
1627
set IC_SIZE [gets $f]
1628
set ICLS [gets $f]
1629
 
1630
  #DC defines
1631
set NO_DC [gets $f]
1632
set DC_WAYS [gets $f]
1633
set DC_SIZE [gets $f]
1634
set DCLS [gets $f]
1635
set SB_IMPLEMENTED [gets $f]
1636
set SB_ENTRIES [gets $f]
1637
set SB_LOG [gets $f]
1638
 
1639
  #MMU defines
1640
set NO_IMMU [gets $f]
1641
set NO_DMMU [gets $f]
1642
 
1643
  #QMEM defines
1644
set QMEM_IMPLEMENTED [gets $f]
1645
set QMEM_BSEL [gets $f]
1646
set QMEM_ACK [gets $f]
1647
 
1648
  #MISC defines
1649
set MAC_IMPLEMENTED [gets $f]
1650
set MAC_SPR_WE [gets $f]
1651
set CFGR_IMPLEMENTED [gets $f]
1652
set SYS_FULL_DECODE [gets $f]
1653
 
1654
 
1655
 
1656
close $f
1657
destroy .dloadconf
1658
 
1659
}
1660
 
1661
proc export { } {
1662
 
1663
 
1664
global ASIC
1665
global VCD_DUMP
1666
global VERBOSE
1667
global targetFPGA
1668
global targetASIC
1669
global ASIC_MULTP2_32X32
1670
global BIST
1671
global RF_RAM
1672
#Wishbone defines
1673
global REGISTERED_OUTPUTS
1674
global REGISTERED_INPUTS
1675
global NO_BURSTS
1676
global WB_RETRY
1677
global WB_CAB
1678
global WB_B3
1679
global CLKDIV2_SUPPORT
1680
global CLKDIV4_SUPPORT
1681
#Misc
1682
global ADDITIONAL_SYNOPSYS_DIRECTIVES
1683
global CASE_DEFAULT
1684
global IMPL_MEM2REG
1685
#IU defines
1686
global SR_EPH_DEF
1687
global IMPL_ADDC
1688
global IMPL_CY
1689
global ADDITIONAL_FLAG_MODIFIERS
1690
global IMPL_DIV
1691
global IMPL_ALU_ROTATE
1692
global MULT_IMPLEMENTED
1693
global LWPWR_MULT
1694
global ALU_COMP
1695
#PM defines
1696
global PM_IMPLEMENTED
1697
global PM_READREGS
1698
global PM_UNUSED_ZERO
1699
global PM_PARTIAL_DECODING
1700
#DU defines
1701
global DU_IMPLEMENTED
1702
global DU_HWBKPTS
1703
global DU_TB_IMPLEMENTED
1704
global DU_READREGS
1705
global DU_UNUSED_ZERO
1706
global DU_STATUS_UNIMPLEMENTED
1707
#PIC defines
1708
global PIC_IMPLEMENTED
1709
global PIC_READREGS
1710
global PIC_UNUSED_ZERO
1711
global PIC_PICMR
1712
global PIC_PICSR
1713
global PIC_INTS
1714
#TT defines
1715
global TT_IMPLEMENTED
1716
global TT_TTMR
1717
global TT_TTSR
1718
global TT_READREGS
1719
#IC CACHES
1720
global NO_IC
1721
global IC_WAYS
1722
global IC_SIZE
1723
global ICLS
1724
#DC defines
1725
global NO_DC
1726
global DC_WAYS
1727
global DC_SIZE
1728
global DCLS
1729
global SB_IMPLEMENTED
1730
global SB_ENTRIES
1731
global SB_LOG
1732
#MMU defines
1733
global NO_IMMU
1734
global NO_DMMU
1735
#QMEM defines
1736
global QMEM_IMPLEMENTED
1737
global QMEM_BSEL
1738
global QMEM_ACK
1739
#MISC defines
1740
global MAC_IMPLEMENTED
1741
global MAC_SPR_WE
1742
global CFGR_IMPLEMENTED
1743
global SYS_FULL_DECODE
1744
 
1745
set errorno [catch { set f [open "or1200_config.v" w] } errorname ]
1746
 
1747
if { $errorno != 0 } {
1748
 errorfile
1749
 return
1750
}
1751
 
1752
if { $ASIC == 1 } {
1753
 puts $f {`define OR1200_ASIC}
1754
}
1755
if { $VCD_DUMP == 1 } {
1756
 puts $f {`define OR1200_VCD_DUMP }
1757
}
1758
if { $VERBOSE == 1 } {
1759
 puts $f {`define OR1200_VERBOSE }
1760
}
1761
 
1762
 
1763
puts $f "`define OR1200_$targetFPGA "
1764
puts $f "`define OR1200_$targetASIC "
1765
 
1766
if { $ASIC_MULTP2_32X32 == 1 } {
1767
 puts $f {`define OR1200_ASIC_MULTP2_32X32 }
1768
} else {
1769
 puts $f {`define OR1200_GENERIC_MULTP2_32X32 }
1770
}
1771
 
1772
if  {$ASIC == 1 && ($targetASIC=="VIRTUALSILICON_SSP" | $targetASIC=="VIRTUALSILICON_STP_T1" | $targetASIC=="VIRTUALSILICON_STP_T2")} {
1773
 if { $BIST == 1 } {
1774
  puts $f {`define OR1200_BIST }
1775
 }
1776
}
1777
 
1778
if { $RF_RAM == 0 } {
1779
  puts $f {`define OR1200_RFRAM_GENERIC }
1780
} elseif { $RF_RAM == 1 } {
1781
  puts $f {`define OR1200_RFRAM_TWOPORT }
1782
} else {
1783
  puts $f {`define OR1200_RFRAM_DUALPORT }
1784
}
1785
 
1786
 
1787
#Wishbone defines
1788
if { $REGISTERED_OUTPUTS==1 } {
1789
 puts $f {`define OR1200_REGISTERED_OUTPUTS }
1790
}
1791
if { $REGISTERED_INPUTS==1 } {
1792
 puts $f {`define OR1200_REGISTERED_INPUTS }
1793
}
1794
if { $NO_BURSTS==1 } {
1795
 puts $f {`define OR1200_NO_BURSTS }
1796
}
1797
if { $WB_RETRY==1 } {
1798
 puts $f {`define OR1200_WB_RETRY }
1799
}
1800
if { $WB_CAB==1 } {
1801
 puts $f {`define OR1200_WB_CAB }
1802
}
1803
if { $WB_B3==1 } {
1804
 puts $f {`define OR1200_WB_B3 }
1805
}
1806
if { $CLKDIV2_SUPPORT==1 } {
1807
 puts $f {`define OR1200_CLKDIV2_SUPPORT }
1808
}
1809
if { $CLKDIV4_SUPPORT==1 } {
1810
 puts $f {`define OR1200_CLKDIV4_SUPPORT }
1811
}
1812
 
1813
#Misc
1814
if { $ADDITIONAL_SYNOPSYS_DIRECTIVES==1 } {
1815
 puts $f {`define OR1200_ADDITIONAL_SYNOPSYS_DIRECTIVES }
1816
}
1817
if { $CASE_DEFAULT==1 } {
1818
 puts $f {`define OR1200_CASE_DEFAULT }
1819
}
1820
if { $IMPL_MEM2REG==1 } {
1821
 puts $f {`define OR1200_IMPL_MEM2REG1 }
1822
} else {
1823
 puts $f {`define OR1200_IMPL_MEM2REG2 }
1824
}
1825
 
1826
#IU defines
1827
 
1828
if { $SR_EPH_DEF==1 } {
1829
 puts $f {`define OR1200_SR_EPH_DEF }
1830
}
1831
if { $IMPL_ADDC==1 } {
1832
 puts $f {`define OR1200_IMPL_ADDC }
1833
}
1834
if { $IMPL_CY==1 } {
1835
 puts $f {`define OR1200_IMPL_CY }
1836
}
1837
if { $ADDITIONAL_FLAG_MODIFIERS==1 } {
1838
 puts $f {`define OR1200_ADDITIONAL_FLAG_MODIFIERS }
1839
}
1840
if { $IMPL_DIV==1 } {
1841
 puts $f {`define OR1200_IMPL_DIV }
1842
}
1843
if { $IMPL_ALU_ROTATE==1 } {
1844
 puts $f {`define OR1200_IMPL_ALU_ROTATE }
1845
}
1846
if { $MULT_IMPLEMENTED==1 } {
1847
 puts $f {`define OR1200_MULT_IMPLEMENTED }
1848
}
1849
if { $LWPWR_MULT==1 } {
1850
 puts $f {`define OR1200_LWPWR_MULT }
1851
}
1852
if { $ALU_COMP==1 } {
1853
 puts $f {`define OR1200_ALU_COMP }
1854
}
1855
 
1856
#PM defines
1857
if { $PM_IMPLEMENTED==1 } {
1858
 puts $f {`define OR1200_PM_IMPLEMENTED }
1859
}
1860
if { $PM_READREGS==1 } {
1861
 puts $f {`define OR1200_PM_READREGS }
1862
}
1863
if { $PM_UNUSED_ZERO==1 } {
1864
 puts $f {`define OR1200_PM_UNUSED_ZERO }
1865
}
1866
if { $PM_PARTIAL_DECODING==1 } {
1867
 puts $f {`define OR1200_PM_PARTIAL_DECODING }
1868
}
1869
 
1870
#DU defines
1871
if { $DU_IMPLEMENTED==1 } {
1872
 puts $f {`define OR1200_DU_IMPLEMENTED }
1873
}
1874
if { $DU_HWBKPTS==1 } {
1875
 puts $f {`define OR1200_DU_HWBKPTS }
1876
}
1877
if { $DU_TB_IMPLEMENTED==1 } {
1878
 puts $f {`define OR1200_DU_TB_IMPLEMENTED }
1879
}
1880
if { $DU_READREGS==1 } {
1881
 puts $f {`define OR1200_DU_READREGS }
1882
}
1883
if { $DU_UNUSED_ZERO==1 } {
1884
 puts $f {`define OR1200_DU_UNUSED_ZERO }
1885
}
1886
if { $DU_STATUS_UNIMPLEMENTED==1 } {
1887
 puts $f {`define OR1200_DU_STATUS_UNIMPLEMENTED }
1888
}
1889
 
1890
 
1891
#PIC defines
1892
if { $PIC_IMPLEMENTED==1 } {
1893
 puts $f {`define OR1200_PIC_IMPLEMENTED }
1894
}
1895
if { $PIC_READREGS==1 } {
1896
 puts $f {`define OR1200_PIC_READREGS }
1897
}
1898
if { $PIC_UNUSED_ZERO==1 } {
1899
 puts $f {`define OR1200_PIC_UNUSED_ZERO }
1900
}
1901
if { $PIC_PICMR==1 } {
1902
 puts $f {`define OR1200_PIC_PICMR }
1903
}
1904
if { $PIC_PICSR==1 } {
1905
 puts $f {`define OR1200_PIC_PICSR }
1906
}
1907
 
1908
puts $f "`define OR1200_PIC_INTS $PIC_INTS"
1909
 
1910
 
1911
 
1912
#TT defines
1913
if { $TT_IMPLEMENTED==1 } {
1914
 puts $f {`define OR1200_TT_IMPLEMENTED }
1915
}
1916
if { $TT_TTMR==1 } {
1917
 puts $f {`define OR1200_TT_TTMR }
1918
}
1919
if { $TT_TTSR==1 } {
1920
 puts $f {`define OR1200_TT_TTSR }
1921
}
1922
if { $TT_READREGS==1 } {
1923
 puts $f {`define OR1200_TT_READREGS }
1924
}
1925
 
1926
#IC CACHES
1927
if { $NO_IC==1 } {
1928
 puts $f {`define OR1200_NO_IC }
1929
}
1930
 
1931
puts $f "`define OR1200_IC_$IC_WAYS\W_$IC_SIZE"
1932
 
1933
if { $ICLS==8 } {
1934
 puts $f {`define OR1200_ICLS 3 }
1935
} else {
1936
 puts $f {`define OR1200_ICLS 4 }
1937
}
1938
 
1939
#DC defines
1940
if { $NO_DC==1 } {
1941
 puts $f {`define OR1200_NO_DC }
1942
}
1943
 
1944
puts $f "`define OR1200_DC_$DC_WAYS\W_$DC_SIZE"
1945
 
1946
if { $DCLS==8 } {
1947
 puts $f {`define OR1200_DCLS 3 }
1948
} else {
1949
 puts $f {`define OR1200_DCLS 4 }
1950
}
1951
 
1952
if { $SB_IMPLEMENTED==1 } {
1953
 puts $f {`define OR1200_SB_IMPLEMENTED }
1954
}
1955
 
1956
puts $f "`define OR1200_SB_ENTRIES $SB_ENTRIES"
1957
 
1958
puts $f "`define OR1200_SB_LOG $SB_LOG"
1959
 
1960
 
1961
#MMU defines
1962
if { $NO_IMMU==1 } {
1963
 puts $f {`define OR1200_NO_IMMU }
1964
}
1965
if { $NO_DMMU==1 } {
1966
 puts $f {`define OR1200_NO_DMMU }
1967
}
1968
 
1969
#QMEM defines
1970
if {$QMEM_IMPLEMENTED == 1} {
1971
 puts $f {`define OR1200_QMEM_IMPLEMENTED }
1972
}
1973
if {$QMEM_BSEL == 1} {
1974
 puts $f {`define OR1200_QMEM_BSEL }
1975
}
1976
if {$QMEM_ACK == 1} {
1977
 puts $f {`define OR1200_QMEM_ACK }
1978
}
1979
 
1980
#MISC defines
1981
if {$MAC_IMPLEMENTED == 1} {
1982
 puts $f {`define OR1200_MAC_IMPLEMENTED }
1983
}
1984
if {$MAC_SPR_WE == 1} {
1985
 puts $f {`define OR1200_MAC_SPR_WE }
1986
}
1987
if {$CFGR_IMPLEMENTED == 1} {
1988
 puts $f {`define OR1200_CFGR_IMPLEMENTED }
1989
}
1990
if {$SYS_FULL_DECODE == 1} {
1991
 puts $f {`define OR1200_SYS_FULL_DECODE }
1992
}
1993
 
1994
close $f
1995
 
1996
 
1997
}
1998
 
1999
 
2000
proc errorfile { } {
2001
 
2002
 destroy .derror
2003
 
2004
 toplevel .derror -class Dialog
2005
 wm title .derror "Error in File Access"
2006
 wm iconname .derror Dialog
2007
 frame .derror.top -relief raised -bd 1
2008
 pack .derror.top -side top -fill both
2009
 frame .derror.bot -relief raised -bd 1
2010
 pack .derror.bot -side top -fill both
2011
 
2012
 
2013
 label .derror.top.fn -text "ERROR IN FILE ACCESS"
2014
 pack .derror.top.fn -side top -pady 5m  -padx 10m
2015
 
2016
 
2017
 button .derror.bot.okb -text "OK" -command { destroy .derror }
2018
 
2019
 pack .derror.bot.okb -side top -padx 10m -pady 5m -fill x
2020
 
2021
 
2022
}
2023
 
2024
 
2025
wm title . "OR1200 Graphic Configuration Tool"
2026
#wm minsize . 1000 600
2027
 
2028
 
2029
defaultvals
2030
 
2031
frame .mbar -relief raised -bd 2
2032
frame .screen -width 15c -height 10c
2033
 
2034
pack .mbar .screen -side top -fill x
2035
 
2036
menubutton .mbar.file -text File -underline 0 -menu .mbar.file.menu
2037
menubutton .mbar.synthesis -text Target -underline 0 -menu .mbar.synthesis.menu
2038
menubutton .mbar.processor -text "Processor Settings" -underline 0 -menu .mbar.processor.menu
2039
menubutton .mbar.wishbone -text Wishbone -underline 0 -menu .mbar.wishbone.menu
2040
menubutton .mbar.misc -text Misc -underline 0 -menu .mbar.misc.menu
2041
menubutton .mbar.simulation -text Simulation -underline 0 -menu .mbar.simulation.menu
2042
menubutton .mbar.help -text Help -underline 0 -menu .mbar.help.menu
2043
 
2044
pack .mbar.file .mbar.synthesis .mbar.processor .mbar.wishbone .mbar.misc .mbar.simulation -side left
2045
pack .mbar.help -side right
2046
 
2047
menu .mbar.file.menu
2048
 
2049
.mbar.file.menu add command -label "Load configuration" -command {loadconfdialog}
2050
.mbar.file.menu add command -label "Save configuration" -command {saveconfdialog}
2051
.mbar.file.menu add separator
2052
.mbar.file.menu add command -label "Generate verilog configuration file" -command { export }
2053
.mbar.file.menu add separator
2054
.mbar.file.menu add command -label "Default values" -command {defaultvals}
2055
.mbar.file.menu add separator
2056
.mbar.file.menu add command -label "Exit" -command {exit}
2057
 
2058
menu .mbar.help.menu
2059
 
2060
.mbar.help.menu add command -label "About ..." -command about
2061
 
2062
 
2063
menu .mbar.simulation.menu
2064
 
2065
.mbar.simulation.menu add checkbutton -label "Dump VCD file" -variable VCD_DUMP
2066
.mbar.simulation.menu add separator
2067
.mbar.simulation.menu add checkbutton -label "Generate debug messages" -variable VERBOSE
2068
 
2069
menu .mbar.synthesis.menu
2070
 
2071
.mbar.synthesis.menu add radiobutton -label "ASIC" -variable ASIC -value 1 -command {confASIC}
2072
.mbar.synthesis.menu add radiobutton -label "FPGA" -variable ASIC -value 0 -command {confFPGA}
2073
 confFPGA
2074
 
2075
menu .mbar.processor.menu
2076
.mbar.processor.menu add command -label "Configure OpenRISC" -command {confOR1200}
2077
 
2078
menu .mbar.wishbone.menu
2079
 
2080
.mbar.wishbone.menu add checkbutton -label "Register WB outputs" -variable REGISTERED_OUTPUTS
2081
.mbar.wishbone.menu add checkbutton -label "Register WB inputs" -variable REGISTERED_INPUTS
2082
.mbar.wishbone.menu add separator
2083
.mbar.wishbone.menu add checkbutton -label "Disable memory bursts" -variable NO_BURSTS
2084
.mbar.wishbone.menu add checkbutton -label "Remove CAB signals" -variable WB_CAB
2085
.mbar.wishbone.menu add separator
2086
.mbar.wishbone.menu add checkbutton -label "Wishbone B3 compatibility" -variable WB_B3
2087
.mbar.wishbone.menu add separator
2088
.mbar.wishbone.menu add checkbutton -label "WB:RISC 1:2 clock ratio" -variable CLKDIV2_SUPPORT
2089
.mbar.wishbone.menu add checkbutton -label "WB:RISC 1:4 clock ratio" -variable CLKDIV4_SUPPORT
2090
.mbar.wishbone.menu add separator
2091
.mbar.wishbone.menu add checkbutton -label "Retry counter enabled" -variable WB_RETRY
2092
 
2093
menu .mbar.misc.menu
2094
 
2095
.mbar.misc.menu add checkbutton -label "Additional Synopsys directives" -variable ADDITIONAL_SYNOPSYS_DIRECTIVES
2096
.mbar.misc.menu add checkbutton -label "Enable default statement in case blocks" -variable CASE_DEFAULT
2097
.mbar.misc.menu add separator
2098
.mbar.misc.menu add radiobutton -label "Type of mem2reg aligner 1" -variable IMPL_MEM2REG -value 1
2099
.mbar.misc.menu add radiobutton -label "Type of mem2reg aligner 2" -variable IMPL_MEM2REG -value 2
2100
.mbar.misc.menu add separator
2101
.mbar.misc.menu add checkbutton -label "Enable BIST (only for VIRTUAL SILICON memories)" -variable BIST
2102
 
2103
tk_menuBar .mbar .mbar.file .mbar.synthesis .mbar.processor .mbar.misc .mbar.simulation .mbar.help
2104
 
2105
focus .mbar

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.