forked from efabless/caravel_mpw-one
-
Notifications
You must be signed in to change notification settings - Fork 1
/
user_project_wrapper.v
820 lines (742 loc) · 29 KB
/
user_project_wrapper.v
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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
/*
*-------------------------------------------------------------
*
* A wrapper for the FPGA IP to fit the I/O interface of Caravel SoC
*
* The wrapper is a technology mapped netlist where the mode-switch
* multiplexers are mapped to the Skywater 130nm
* High-Density (HD) standard cells
*
*-------------------------------------------------------------
*/
`default_nettype none
/*
*-------------------------------------------------------------
*
* user_project_wrapper
*
* This wrapper enumerates all of the pins available to the
* user for the user project.
*
* An example user project is provided in this wrapper. The
* example should be removed and replaced with the actual
* user project.
*
*-------------------------------------------------------------
*/
`define MPRJ_IO_PADS 38
module user_project_wrapper #(
parameter BITS = 32
)(
`ifdef USE_POWER_PINS
inout vdda1, // User area 1 3.3V supply
inout vdda2, // User area 2 3.3V supply
inout vssa1, // User area 1 analog ground
inout vssa2, // User area 2 analog ground
inout vccd1, // User area 1 1.8V supply
inout vccd2, // User area 2 1.8v supply
inout vssd1, // User area 1 digital ground
inout vssd2, // User area 2 digital ground
`endif
// Wishbone Slave ports (WB MI A)
input wb_clk_i,
input wb_rst_i,
input wbs_stb_i,
input wbs_cyc_i,
input wbs_we_i,
input [3:0] wbs_sel_i,
input [31:0] wbs_dat_i,
input [31:0] wbs_adr_i,
output wbs_ack_o,
output [31:0] wbs_dat_o,
// Logic Analyzer Signals
input [127:0] la_data_in,
output [127:0] la_data_out,
input [127:0] la_oen,
// IOs
input [`MPRJ_IO_PADS-1:0] io_in,
output [`MPRJ_IO_PADS-1:0] io_out,
output [`MPRJ_IO_PADS-1:0] io_oeb,
// Analog (direct connection to GPIO pad---use with caution)
// Note that analog I/O is not available on the 7 lowest-numbered
// GPIO pads, and so the analog_io indexing is offset from the
// GPIO indexing by 7.
inout [`MPRJ_IO_PADS-8:0] analog_io,
// Independent clock (on independent integer divider)
input user_clock2
);
/*
FPGA Top-IOs
gfpga_pad_EMBEDDED_IO_HD_SOC*[0-8]
FPGA Bottom-IOs
gfpga_pad_EMBEDDED_IO_HD_SOC*[16-87]
FPGA Right-IOs
gfpga_pad_EMBEDDED_IO_HD_SOC*[8-15]
FPGA Left-IOs
gfpga_pad_EMBEDDED_IO_HD_SOC*[88-95]
IOs Connections:
Caravel IO | FPGA | Mode
io_in[0] | test_en | Input
io_in[1] | IO_ISOL_N | Input
io_out[7:2] | EMBED-IO[10:15] | Bi-directional
io_out[11] | sc_tail | Output
io_in[12] | ccff_head | Input
io_in[13:14] | EMBED-IO[8:9]* | Bi-directional
io_in[17:23] | EMBED-IO[1:8]* | Bi-directional
io_in[24] | EMBED-IO[0]* | Bi-directional
io_in[25] | wb_la_switch | Input
io_in[26] | sc_head | Input
io_in[27:34] | EMBED-IO[88-95]*| Bi-directional
io_out[35] | ccff_tail | Output
io_in[36] | clk | Input
io_in[37] | prog_clk | Input
*/
// FPGA wires
wire prog_clk;
wire Test_en;
wire io_isol_n;
wire clk;
wire [95:0] gfpga_pad_EMBEDDED_IO_HD_SOC_IN;
wire [95:0] gfpga_pad_EMBEDDED_IO_HD_SOC_OUT;
wire [95:0] gfpga_pad_EMBEDDED_IO_HD_SOC_DIR;
wire ccff_head;
wire ccff_tail;
wire sc_head;
wire sc_tail;
// Switch between wishbone and logic analyzer
wire wb_la_switch;
wire wb_la_switch_b;
// Inverted switch signal to drive tri-state buffers
// Use drive strength 8 as we will have 33 output pins which is driven by
// the buffers
sky130_fd_sc_hd__inv_8 WB_LA_SWITCH_INV (.A(wb_la_switch), .Y(wb_la_switch_b));
// Wire-bond TOP side I/O of FPGA to LEFT-side of Caravel interface
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[0] = io_in[24];
assign io_out[24] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[0];
assign io_oeb[24] = gfpga_pad_EMBEDDED_IO_HD_SOC_DIR[0];
// Wire-bond TOP side I/O of FPGA to TOP-side of Caravel interface
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[8:1] = io_in[23:16];
assign io_out[23:16] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[8:1];
assign io_oeb[23:16] = gfpga_pad_EMBEDDED_IO_HD_SOC_DIR[8:1];
// Wire-bond TOP side I/O of FPGA to RIGHT-side of Caravel interface
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[9] = io_in[14];
assign io_out[14] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[9];
assign io_oeb[14] = gfpga_pad_EMBEDDED_IO_HD_SOC_DIR[9];
// CCFF_HEAD - Input
// Wire-bond RIGHT side I/O of FPGA to RIGHT-side of Caravel interface
assign ccff_head = io_in[12];
assign io_out[12] = 1'b0;
assign io_oeb[12] = 1'b1;
// SC_TAIL -- output
assign io_out[11] = sc_tail;
assign io_oeb[11] = 1'b0;
// Embedded-IOs -- Bidirectional
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[15:10] = io_in[7:2];
assign io_out[7:2] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[15:10];
assign io_oeb[7:2] = gfpga_pad_EMBEDDED_IO_HD_SOC_DIR[15:10];
// IO_ISOL_N -- Input
assign io_isol_n = io_in[1];
assign io_out[1] = 1'b0;
assign io_oeb[1] = 1'b1;
// Test_en -- Input
assign Test_en = io_in[0];
assign io_out[0] = 1'b0;
assign io_oeb[0] = 1'b1;
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_0_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[31]),
.A0(la_data_in[86]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[57]));
assign la_data_out[86] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[57];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_1_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[30]),
.A0(la_data_in[85]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[58]));
assign la_data_out[85] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[58];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_2_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[29]),
.A0(la_data_in[84]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[59]));
assign la_data_out[84] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[59];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_3_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[28]),
.A0(la_data_in[83]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[60]));
assign la_data_out[83] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[60];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_4_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[27]),
.A0(la_data_in[82]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[61]));
assign la_data_out[82] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[61];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_5_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[26]),
.A0(la_data_in[81]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[62]));
assign la_data_out[81] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[62];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_6_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[25]),
.A0(la_data_in[80]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[63]));
assign la_data_out[80] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[63];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_7_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[24]),
.A0(la_data_in[79]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[64]));
assign la_data_out[79] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[64];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_8_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[23]),
.A0(la_data_in[78]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[65]));
assign la_data_out[78] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[65];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_9_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[22]),
.A0(la_data_in[77]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[66]));
assign la_data_out[77] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[66];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_10_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[21]),
.A0(la_data_in[76]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[67]));
assign la_data_out[76] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[67];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_11_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[20]),
.A0(la_data_in[75]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[68]));
assign la_data_out[75] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[68];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_12_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[19]),
.A0(la_data_in[74]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[69]));
assign la_data_out[74] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[69];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_13_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[18]),
.A0(la_data_in[73]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[70]));
assign la_data_out[73] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[70];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_14_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[17]),
.A0(la_data_in[72]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[71]));
assign la_data_out[72] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[71];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_15_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[16]),
.A0(la_data_in[71]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[72]));
assign la_data_out[71] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[72];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_16_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[15]),
.A0(la_data_in[70]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[73]));
assign la_data_out[70] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[73];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_17_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[14]),
.A0(la_data_in[69]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[74]));
assign la_data_out[69] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[74];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_18_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[13]),
.A0(la_data_in[68]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[75]));
assign la_data_out[68] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[75];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_19_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[12]),
.A0(la_data_in[67]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[76]));
assign la_data_out[67] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[76];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_20_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[11]),
.A0(la_data_in[66]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[77]));
assign la_data_out[66] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[77];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_21_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[10]),
.A0(la_data_in[65]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[78]));
assign la_data_out[65] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[78];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_22_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[9]),
.A0(la_data_in[64]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[79]));
assign la_data_out[64] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[79];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_23_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[8]),
.A0(la_data_in[63]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[80]));
assign la_data_out[63] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[80];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_24_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[7]),
.A0(la_data_in[62]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[81]));
assign la_data_out[62] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[81];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_25_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[6]),
.A0(la_data_in[61]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[82]));
assign la_data_out[61] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[82];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_26_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[5]),
.A0(la_data_in[60]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[83]));
assign la_data_out[60] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[83];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_27_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[4]),
.A0(la_data_in[59]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[84]));
assign la_data_out[59] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[84];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_28_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[3]),
.A0(la_data_in[58]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[85]));
assign la_data_out[58] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[85];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_29_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[2]),
.A0(la_data_in[57]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[86]));
assign la_data_out[57] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[86];
sky130_fd_sc_hd__mux2_1 FPGA2SOC_IN_30_MUX (
.S(wb_la_switch),
.A1(wbs_dat_i[1]),
.A0(la_data_in[56]),
.X(gfpga_pad_EMBEDDED_IO_HD_SOC_IN[87]));
assign la_data_out[56] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[87];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[25] = la_data_in[118];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_0_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[25]),
.Z(wbs_dat_o[31])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_0_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[25]),
.Z(la_data_out[118])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[26] = la_data_in[117];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_1_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[26]),
.Z(wbs_dat_o[30])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_1_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[26]),
.Z(la_data_out[117])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[27] = la_data_in[116];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_2_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[27]),
.Z(wbs_dat_o[29])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_2_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[27]),
.Z(la_data_out[116])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[28] = la_data_in[115];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_3_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[28]),
.Z(wbs_dat_o[28])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_3_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[28]),
.Z(la_data_out[115])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[29] = la_data_in[114];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_4_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[29]),
.Z(wbs_dat_o[27])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_4_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[29]),
.Z(la_data_out[114])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[30] = la_data_in[113];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_5_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[30]),
.Z(wbs_dat_o[26])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_5_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[30]),
.Z(la_data_out[113])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[31] = la_data_in[112];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_6_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[31]),
.Z(wbs_dat_o[25])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_6_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[31]),
.Z(la_data_out[112])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[32] = la_data_in[111];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_7_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[32]),
.Z(wbs_dat_o[24])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_7_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[32]),
.Z(la_data_out[111])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[33] = la_data_in[110];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_8_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[33]),
.Z(wbs_dat_o[23])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_8_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[33]),
.Z(la_data_out[110])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[34] = la_data_in[109];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_9_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[34]),
.Z(wbs_dat_o[22])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_9_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[34]),
.Z(la_data_out[109])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[35] = la_data_in[108];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_10_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[35]),
.Z(wbs_dat_o[21])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_10_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[35]),
.Z(la_data_out[108])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[36] = la_data_in[107];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_11_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[36]),
.Z(wbs_dat_o[20])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_11_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[36]),
.Z(la_data_out[107])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[37] = la_data_in[106];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_12_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[37]),
.Z(wbs_dat_o[19])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_12_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[37]),
.Z(la_data_out[106])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[38] = la_data_in[105];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_13_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[38]),
.Z(wbs_dat_o[18])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_13_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[38]),
.Z(la_data_out[105])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[39] = la_data_in[104];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_14_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[39]),
.Z(wbs_dat_o[17])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_14_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[39]),
.Z(la_data_out[104])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[40] = la_data_in[103];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_15_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[40]),
.Z(wbs_dat_o[16])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_15_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[40]),
.Z(la_data_out[103])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[41] = la_data_in[102];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_16_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[41]),
.Z(wbs_dat_o[15])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_16_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[41]),
.Z(la_data_out[102])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[42] = la_data_in[101];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_17_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[42]),
.Z(wbs_dat_o[14])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_17_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[42]),
.Z(la_data_out[101])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[43] = la_data_in[100];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_18_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[43]),
.Z(wbs_dat_o[13])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_18_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[43]),
.Z(la_data_out[100])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[44] = la_data_in[99];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_19_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[44]),
.Z(wbs_dat_o[12])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_19_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[44]),
.Z(la_data_out[99])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[45] = la_data_in[98];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_20_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[45]),
.Z(wbs_dat_o[11])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_20_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[45]),
.Z(la_data_out[98])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[46] = la_data_in[97];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_21_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[46]),
.Z(wbs_dat_o[10])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_21_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[46]),
.Z(la_data_out[97])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[47] = la_data_in[96];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_22_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[47]),
.Z(wbs_dat_o[9])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_22_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[47]),
.Z(la_data_out[96])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[48] = la_data_in[95];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_23_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[48]),
.Z(wbs_dat_o[8])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_23_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[48]),
.Z(la_data_out[95])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[49] = la_data_in[94];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_24_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[49]),
.Z(wbs_dat_o[7])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_24_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[49]),
.Z(la_data_out[94])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[50] = la_data_in[93];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_25_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[50]),
.Z(wbs_dat_o[6])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_25_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[50]),
.Z(la_data_out[93])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[51] = la_data_in[92];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_26_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[51]),
.Z(wbs_dat_o[5])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_26_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[51]),
.Z(la_data_out[92])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[52] = la_data_in[91];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_27_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[52]),
.Z(wbs_dat_o[4])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_27_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[52]),
.Z(la_data_out[91])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[53] = la_data_in[90];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_28_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[53]),
.Z(wbs_dat_o[3])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_28_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[53]),
.Z(la_data_out[90])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[54] = la_data_in[89];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_29_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[54]),
.Z(wbs_dat_o[2])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_29_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[54]),
.Z(la_data_out[89])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[55] = la_data_in[88];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_30_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[55]),
.Z(wbs_dat_o[1])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_30_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[55]),
.Z(la_data_out[88])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[56] = la_data_in[87];
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_31_DEMUX_WB (
.TE_B(wb_la_switch_b),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[56]),
.Z(wbs_dat_o[0])
);
sky130_fd_sc_hd__ebufn_4 FPGA2SOC_OUT_31_DEMUX_LA (
.TE_B(wb_la_switch),
.A(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[56]),
.Z(la_data_out[87])
);
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[24] = la_data_in[119];
assign la_data_out[119] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[24];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[23] = la_data_in[120];
assign la_data_out[120] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[23];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[22] = la_data_in[121];
assign la_data_out[121] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[22];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[21] = la_data_in[122];
assign la_data_out[122] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[21];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[20] = la_data_in[123];
assign la_data_out[123] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[20];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[19] = la_data_in[124];
assign la_data_out[124] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[19];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[18] = la_data_in[125];
assign la_data_out[125] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[18];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[17] = la_data_in[126];
assign la_data_out[126] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[17];
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[16] = la_data_in[127];
assign la_data_out[127] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[16];
// Autogenerate code end
// PROG-CLK -- Input
// Wire-bond LEFT side I/O of FPGA to LEFT-side of Caravel interface
assign prog_clk = io_in[37];
assign io_out[37] = 1'b0;
assign io_oeb[37] = 1'b1;
// CLK -- Input
// FPGA clock port can be driven by either wishbone clock or an GPIO
assign clk = io_in[36];
assign io_out[36] = 1'b0;
assign io_oeb[36] = 1'b1;
// CCFF-TAIL - Output
assign io_out[35] = ccff_tail;
assign io_oeb[35] = 1'b0;
// SOC-IN - Bidirectional
assign gfpga_pad_EMBEDDED_IO_HD_SOC_IN[95:88] = io_in[34:27];
assign io_out[34:27] = gfpga_pad_EMBEDDED_IO_HD_SOC_OUT[95:88];
assign io_oeb[34:27] = gfpga_pad_EMBEDDED_IO_HD_SOC_DIR[95:88];
// SC-HEAD -- Input
assign sc_head = io_in[26];
assign io_out[26] = 1'b0;
assign io_oeb[26] = 1'b1;
// -- Input
// I/O[25] is reserved for a switch between wishbone interface
// and logic analyzer
assign wb_la_switch = io_in[25];
assign io_out[25] = 1'b0;
assign io_oeb[25] = 1'b1;
// TODO: Connect spypad from FPGA to logic analyzer ports
fpga_core fpga_core_uut(.prog_clk(prog_clk),
.Test_en(Test_en),
.clk(clk),
.IO_ISOL_N(io_isol_n),
.gfpga_pad_EMBEDDED_IO_HD_SOC_IN(gfpga_pad_EMBEDDED_IO_HD_SOC_IN),
.gfpga_pad_EMBEDDED_IO_HD_SOC_OUT(gfpga_pad_EMBEDDED_IO_HD_SOC_OUT),
.gfpga_pad_EMBEDDED_IO_HD_SOC_DIR(gfpga_pad_EMBEDDED_IO_HD_SOC_DIR),
.ccff_head(ccff_head),
.ccff_tail(ccff_tail),
.sc_head(sc_head),
.sc_tail(sc_tail)
);
endmodule