Skip to content

Commit fb4b279

Browse files
Init and enable Cobble for repo
1 parent bd35df2 commit fb4b279

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed

BUILD.conf

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# -*- python -*- vim:syntax=python:
2+
3+
plugin_path(
4+
'tools/site_cobble',
5+
'vnd/cobble/tools/site_cobble',
6+
'vnd/cobble/src/cobble/target')
7+
8+
install('bluespec')
9+
install('c')
10+
install('nextpnr')
11+
install('shell')
12+
install('yosys')
13+
14+
environment('default', contents = {
15+
'bsc': VARS.get('bluespec', 'bin', default='bsc'),
16+
'bsc_flags': [
17+
'-q',
18+
'-show-range-conflict',
19+
],
20+
'bluescan': ROOT + 'vnd/cobble/tools/site_cobble/bluescan.py',
21+
'bluescan_flags' : [
22+
'--bs-prefix ' + VARS.get('bluespec', 'prefix', default='/opt/bluespec')
23+
],
24+
'yosys': VARS.get('yosys', 'bin', default='yosys'),
25+
26+
'cxx': VARS.get('c', 'cxx', default='c++'),
27+
'cxx_flags': [
28+
'-std=c++17',
29+
'-Werror-all',
30+
'-I' + ROOT,
31+
],
32+
'c_link_flags': [
33+
],
34+
'ar': VARS.get('c', 'ar', default='ar'),
35+
})
36+
37+
environment('bluesim_default', base = 'default', contents = {
38+
'bsc_flags': [
39+
'-keep-fires',
40+
'-check-assert',
41+
],
42+
})
43+
44+
environment('cxxrtl_default', base = 'default', contents = {
45+
'yosys_cmds': [
46+
'hierarchy -top $$top_module',
47+
],
48+
'yosys_backend': 'cxxrtl -header',
49+
'cxx_flags': [
50+
'-Wno-array-bounds',
51+
'-Wno-shift-count-overflow',
52+
],
53+
})
54+
55+
# FPGA Family environments.
56+
environment('ecp5', base = 'default', contents = {
57+
# Default synthesis commands for ECP5.
58+
'yosys_cmds': [
59+
'synth_ecp5 -top $$top_module',
60+
],
61+
'yosys_backend': 'json', # nextpnr assumes JSON input.
62+
'nextpnr_ecp5': VARS.get('nextpnr', 'ecp5', default='nextpnr-ecp5'),
63+
'nextpnr_ecp5_flags': [
64+
'-q',
65+
],
66+
'nextpnr_ecp5_pack': VARS.get('nextpnr', 'ecp5_pack', default='ecppack'),
67+
})
68+
environment('ice40', base = 'default', contents = {
69+
'yosys_cmds': [
70+
'synth_ice40 -top $$top_module',
71+
],
72+
'yosys_backend': 'json', # nextpnr assumes JSON input.
73+
'nextpnr_ice40': VARS.get('nextpnr', 'ice40', default='nextpnr-ice40'),
74+
'nextpnr_ice40_flags': [
75+
'-q',
76+
],
77+
'nextpnr_ice40_pack': VARS.get('nextpnr', 'ice40_pack', default='icepack'),
78+
})
79+
80+
# Board environments/variants.
81+
environment('ecp5_evn', base = 'ecp5', contents = {
82+
'nextpnr_ecp5_flags': [
83+
'--um5g-85k',
84+
'--package CABGA381',
85+
],
86+
'nextpnr_constraints': ROOT + '/vnd/cobalt/hdl/boards/ecp5_evn/ecp5_evn_basic.lpf',
87+
})
88+
environment('ulx3s', base = 'ecp5', contents = {
89+
'nextpnr_ecp5_flags': [
90+
'--85k',
91+
'--package CABGA381',
92+
],
93+
'nextpnr_constraints': ROOT + '/vnd/cobalt/hdl/boards/ulx3s/ulx3s_v20.lpf',
94+
})
95+
environment('icestick', base = 'ice40', contents = {
96+
'nextpnr_ice40_flags': [
97+
'--hx1k',
98+
'--package tq144',
99+
],
100+
'nextpnr_constraints': ROOT + '/vnd/cobalt/hdl/boards/icestick/icestick.pcf',
101+
})
102+
103+
seed('//hdl')

BUILD.vars.example

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[bluespec]
2+
prefix = "/usr/local"
3+
bin = "/usr/local/bin/bsc"
4+
libdir = "/usr/local/lib/bluespec"
5+
6+
[yosys]
7+
bin = "/usr/local/bin/yosys"
8+
libdir = "/usr/local/share/yosys"
9+
10+
[nextpnr]
11+
ecp5 = "/usr/local/bin/nextpnr-ecp5"
12+
ecp5_pack = "/usr/local/bin/ecppack"
13+
ice40 = "/usr/local/bin/nextpnr-ice40"
14+
ice40_pack = "/usr/local/bin/icepack"

hdl/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- python -*- vim:syntax=python:

tools/site_cobble/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Quartz specific Cobble plugins go here. But consider whether they are generic enough to go into
2+
vnd/cobalt/tools/site_cobble.

0 commit comments

Comments
 (0)