|
| 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') |
0 commit comments