Skip to content

Commit 9c953db

Browse files
committed
Place holder examples
1 parent ba601ac commit 9c953db

File tree

4 files changed

+262
-0
lines changed

4 files changed

+262
-0
lines changed

examples/chip/chip.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import lambdalib as ll
2+
from siliconcompiler import DesignSchema
3+
4+
class Chip(DesignSchema):
5+
def __init__(self):
6+
7+
name = 'chip'
8+
super().__init__(name)
9+
10+
fileset = 'rtl'
11+
dataroot = f'{name}'
12+
topmodule = name
13+
14+
sources = [f'rtl/{name}.v']
15+
16+
self.set_dataroot(dataroot, __file__)
17+
self.set_topmodule(topmodule, fileset)
18+
19+
for item in sources:
20+
self.add_file(item, fileset, dataroot=dataroot)
21+
22+
self.add_idir('rtl', fileset, dataroot=dataroot)
23+
24+
# dependencies
25+
for dep in [ll.padring.Padring]:
26+
self.add_depfileset(dep(), depfileset='rtl', fileset='rtl')
27+
28+
if __name__ == "__main__":
29+
d = Chip()
30+
d.write_fileset(f"{d.name()}.f", fileset="rtl")
31+
cmd = ['yosys', '-f', script]
32+
return subprocess.run(cmd,
33+
stderr=subprocess.STDOUT,
34+
check=True)

examples/chip/rtl/chip.v

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
module chip #(parameter NO_NPINS = 16,
2+
parameter EA_NPINS = 16,
3+
parameter WE_NPINS = 16,
4+
parameter SO_NPINS = 16)
5+
(
6+
input VSS,
7+
input VDD,
8+
input NVCC,
9+
input EVCC,
10+
input WVCC,
11+
input SVCC,
12+
inout [NO_NPINS-1:0] NIO,
13+
inout [EA_NPINS-1:0] EIO,
14+
inout [WE_NPINS-1:0] WIO,
15+
inout [SO_NPINS-1:0] SIO
16+
);
17+
18+
`include "chip_iomap.vh"
19+
20+
wire [NO_NSECTIONS*RINGW-1:0] no_ioring;
21+
wire [EA_NSECTIONS*RINGW-1:0] ea_ioring;
22+
wire [WE_NSECTIONS*RINGW-1:0] we_ioring;
23+
wire [SO_NSECTIONS*RINGW-1:0] so_ioring;
24+
25+
wire [NO_NPINS-1:0] no_rxd;
26+
wire [EA_NPINS-1:0] ea_rxd;
27+
wire [WE_NPINS-1:0] we_rxd;
28+
wire [SO_NPINS-1:0] so_rxd;
29+
30+
la_padring #(// padring ctrl widths
31+
.RINGW(RINGW),
32+
.CFGW(CFGW),
33+
//north
34+
.NO_NPINS(NO_NPINS),
35+
.NO_NCELLS(NO_NCELLS),
36+
.NO_NSECTIONS(NO_NSECTIONS),
37+
.NO_CELLMAP(NO_CELLMAP),
38+
//east
39+
.EA_NPINS(EA_NPINS),
40+
.EA_NCELLS(EA_NCELLS),
41+
.EA_NSECTIONS(EA_NSECTIONS),
42+
.EA_CELLMAP(EA_CELLMAP),
43+
//south
44+
.SO_NPINS(SO_NPINS),
45+
.SO_NCELLS(SO_NCELLS),
46+
.SO_NSECTIONS(SO_NSECTIONS),
47+
.SO_CELLMAP(SO_CELLMAP),
48+
//west
49+
.WE_NPINS(WE_NPINS),
50+
.WE_NCELLS(WE_NCELLS),
51+
.WE_NSECTIONS(WE_NSECTIONS),
52+
.WE_CELLMAP(WE_CELLMAP))
53+
la_padring(// Outputs
54+
.no_zp (no_rxd[NO_NPINS-1:0]),
55+
.no_zn (),
56+
.ea_zp (ea_rxd[EA_NPINS-1:0]),
57+
.ea_zn (),
58+
.so_zp (so_rxd[SO_NPINS-1:0]),
59+
.so_zn (),
60+
.we_zp (we_rxd[WE_NPINS-1:0]),
61+
.we_zn (),
62+
// Inouts
63+
.vss (VSS),
64+
.no_pad (NIO),
65+
.no_aio (),
66+
.no_vdd (VDD),
67+
.no_vddio (NVCC),
68+
.no_vssio (VSS),
69+
.no_ioring (no_ioring[NO_NSECTIONS*RINGW-1:0]),
70+
.ea_pad (EIO),
71+
.ea_aio (),
72+
.ea_vdd (VDD),
73+
.ea_vddio (EVCC),
74+
.ea_vssio (VSS),
75+
.ea_ioring (ea_ioring[EA_NSECTIONS*RINGW-1:0]),
76+
.so_pad (SIO),
77+
.so_aio (),
78+
.so_vdd (VDD),
79+
.so_vddio (SVCC),
80+
.so_vssio (VSS),
81+
.so_ioring (so_ioring[SO_NSECTIONS*RINGW-1:0]),
82+
.we_pad (WIO),
83+
.we_aio (),
84+
.we_vdd (VDD),
85+
.we_vddio (WVCC),
86+
.we_vssio (VSS),
87+
.we_ioring (we_ioring[WE_NSECTIONS*RINGW-1:0]),
88+
// Inputs
89+
.no_a ({NO_NPINS{1'b0}}),
90+
.no_ie ({NO_NPINS{1'b1}}),
91+
.no_oe ({NO_NPINS{1'b0}}),
92+
.no_pe ({NO_NPINS{1'b0}}),
93+
.no_ps ({NO_NPINS{1'b0}}),
94+
.no_cfg ({(NO_NPINS*CFGW){1'b0}}),
95+
.ea_a ({EA_NPINS{1'b0}}),
96+
.ea_ie ({EA_NPINS{1'b1}}),
97+
.ea_oe ({EA_NPINS{1'b0}}),
98+
.ea_pe ({EA_NPINS{1'b0}}),
99+
.ea_ps ({EA_NPINS{1'b0}}),
100+
.ea_cfg ({(EA_NPINS*CFGW){1'b0}}),
101+
.we_a ({WE_NPINS{1'b0}}),
102+
.we_ie ({WE_NPINS{1'b1}}),
103+
.we_oe ({WE_NPINS{1'b0}}),
104+
.we_pe ({WE_NPINS{1'b0}}),
105+
.we_ps ({WE_NPINS{1'b0}}),
106+
.we_cfg ({(WE_NPINS*CFGW){1'b0}}),
107+
.so_a ({SO_NPINS{1'b0}}),
108+
.so_ie ({SO_NPINS{1'b1}}),
109+
.so_oe ({SO_NPINS{1'b0}}),
110+
.so_pe ({SO_NPINS{1'b0}}),
111+
.so_ps ({SO_NPINS{1'b0}}),
112+
.so_cfg ({(SO_NPINS*CFGW){1'b0}})
113+
);
114+
115+
endmodule

examples/chip/rtl/chip_iomap.vh

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
//########################################################################
2+
// Common Padring Definitions
3+
//########################################################################
4+
5+
`include "la_padring.vh"
6+
7+
//########################################################################
8+
// Total number of IO cells in one padring side (including power)
9+
//########################################################################
10+
11+
// 16 bidirs
12+
// 12 power ground
13+
// 2 cut cells
14+
// 1 poc
15+
16+
localparam NCELLS = 31;
17+
18+
//########################################################################
19+
// Power sections per side
20+
//########################################################################
21+
22+
localparam NSECTIONS = 1;
23+
24+
//########################################################################
25+
// Tech specific iolib parameters
26+
//########################################################################
27+
28+
// total width of config bus (drive strength, schmitt, ...)
29+
localparam CFGW = 6;
30+
31+
// width of bus that goes around ioring
32+
localparam RINGW = 6;
33+
34+
//########################################################################
35+
// CELLMAP[NCELLS*40-1:0] = {PROP, SECTION, CELL, CPIN#, PIN#}
36+
//########################################################################
37+
38+
/* The CELLMAP vector specifies the type, order, power rail, and pin
39+
* connection for each cell placed in a side of the io padring.
40+
*
41+
* CELLMAP is used by la_padside which iterates from 0 to NCELLS-1 to
42+
* instantiate padring cells. The index for that for loop is used
43+
* to find the power section, pin number, and cell type in the
44+
* static definition below. The indices of the cells are specified from
45+
* left to right or top to bottom. The CELLMAP[0] is the first cell
46+
* placed.
47+
*
48+
* All enumerationsa arer defined in the la_iopadring.vh
49+
*
50+
* [7:0] PIN# = pin# (order 0-255)
51+
* [15:8] COMPLEMENT PIN# = pin# (order 0-255)
52+
* [23:16] CELL = cell type from lambdalib (0-255)
53+
* [31:24] SECTION = power rail selector (when NSECTIONS>1)
54+
* [39:32] PROP = cell property (optional)
55+
*
56+
*/
57+
58+
localparam [NCELLS*40-1:0] CELLMAP =
59+
{{NULL, NULL, LA_CUT, NULL, NULL},
60+
{NULL, NULL, LA_BIDIR, NULL, PIN15},
61+
{NULL, NULL, LA_BIDIR, NULL, PIN14},
62+
{NULL, NULL, LA_BIDIR, NULL, PIN13},
63+
{NULL, NULL, LA_BIDIR, NULL, PIN12},
64+
{NULL, NULL, LA_VSS, NULL, NULL},
65+
{NULL, NULL, LA_VDD, NULL, NULL},
66+
{NULL, NULL, LA_VDDIO, NULL, NULL},
67+
{NULL, NULL, LA_VSSIO, NULL, NULL},
68+
{NULL, NULL, LA_BIDIR, NULL, PIN11},
69+
{NULL, NULL, LA_BIDIR, NULL, PIN10},
70+
{NULL, NULL, LA_BIDIR, NULL, PIN9},
71+
{NULL, NULL, LA_BIDIR, NULL, PIN8},
72+
{NULL, NULL, LA_VSS, NULL, NULL},
73+
{NULL, NULL, LA_VDD, NULL, NULL},
74+
{NULL, NULL, LA_POC, NULL, NULL},
75+
{NULL, NULL, LA_VDDIO, NULL, NULL},
76+
{NULL, NULL, LA_VSSIO, NULL, NULL},
77+
{NULL, NULL, LA_BIDIR, NULL, PIN7},
78+
{NULL, NULL, LA_BIDIR, NULL, PIN6},
79+
{NULL, NULL, LA_BIDIR, NULL, PIN5},
80+
{NULL, NULL, LA_BIDIR, NULL, PIN4},
81+
{NULL, NULL, LA_VSS, NULL, NULL},
82+
{NULL, NULL, LA_VDD, NULL, NULL},
83+
{NULL, NULL, LA_VDDIO, NULL, NULL},
84+
{NULL, NULL, LA_VSSIO, NULL, NULL},
85+
{NULL, NULL, LA_BIDIR, NULL, PIN3},
86+
{NULL, NULL, LA_BIDIR, NULL, PIN2},
87+
{NULL, NULL, LA_BIDIR, NULL, PIN1},
88+
{NULL, NULL, LA_BIDIR, NULL, PIN0},
89+
{NULL, NULL, LA_CUT, NULL, NULL}};
90+
91+
//########################################################################
92+
// Symmetrical padring for simplicity (not a restriction)
93+
//########################################################################
94+
95+
localparam NO_NCELLS = NCELLS;
96+
localparam EA_NCELLS = NCELLS;
97+
localparam WE_NCELLS = NCELLS;
98+
localparam SO_NCELLS = NCELLS;
99+
100+
localparam NO_NSECTIONS = NSECTIONS;
101+
localparam EA_NSECTIONS = NSECTIONS;
102+
localparam WE_NSECTIONS = NSECTIONS;
103+
localparam SO_NSECTIONS = NSECTIONS;
104+
105+
localparam NO_CELLMAP = CELLMAP;
106+
localparam EA_CELLMAP = CELLMAP;
107+
localparam WE_CELLMAP = CELLMAP;
108+
localparam SO_CELLMAP = CELLMAP;

examples/sram/rtl/sram.v

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module sram();
2+
3+
// TODO: put in la_spram
4+
5+
endmodule

0 commit comments

Comments
 (0)