Skip to content

Commit b42843a

Browse files
committed
configure: added examples
1 parent 7c52de9 commit b42843a

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

examples/configure/defaults.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from openflow.configure import ConfigureTools
2+
3+
cfg = ConfigureTools()
4+
5+
for tool in cfg.get_tools():
6+
print(cfg.get_command(tool))

examples/configure/file.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from openflow.configure import ConfigureTools
2+
3+
cfg = ConfigureTools('../openflow.yml')
4+
5+
for tool in cfg.get_tools():
6+
print(cfg.get_command(tool))

examples/configure/methods.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from openflow.configure import ConfigureTools
2+
3+
cfg = ConfigureTools()
4+
5+
print('* Defaults for GHDL:')
6+
print(cfg.get_command('ghdl'))
7+
8+
print('* Setting a different engine:')
9+
cfg.set_engine('podman')
10+
print(cfg.get_command('ghdl'))
11+
12+
print('* Setting different volumes:')
13+
cfg.set_volumes(['v1:v1', 'v2:v2'])
14+
print(cfg.get_command('ghdl'))
15+
16+
print('* Setting a different work:')
17+
cfg.set_work('/tmp')
18+
print(cfg.get_command('ghdl'))
19+
20+
print('* Setting a new container:')
21+
cfg.set_container('ghdl', 'alt-ghdl-container')
22+
print(cfg.get_command('ghdl'))
23+
24+
print('* Setting a new container (with extra options):')
25+
cfg.set_container('ghdl', '--device /dev/bus/usb alt-ghdl-container')
26+
print(cfg.get_command('ghdl'))
27+
28+
print('* Setting a new tool name:')
29+
cfg.set_name('ghdl', 'alt-ghdl-name')
30+
print(cfg.get_command('ghdl'))

examples/openflow.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
engine: docker
2+
volumes:
3+
- "$HOME:$HOME"
4+
work: $PWD
5+
containers:
6+
ecppack: "hdlc/prjtrellis"
7+
ghdl: "hdlc/ghdl:yosys"
8+
icepack: "hdlc/icestorm"
9+
iceprog: "--device /dev/bus/usb hdlc/icestorm"
10+
icetime: "hdlc/icestorm"
11+
nextpnr-ecp5: "hdlc/nextpnr:ecp5"
12+
nextpnr-ice40: "hdlc/nextpnr:ice40"
13+
openocd: "--device /dev/bus/usb hdlc/prog"
14+
yosys: "hdlc/ghdl:yosys"
15+
names:
16+
ecppack: ecppack
17+
ghdl: ghdl
18+
icepack: icepack
19+
iceprog: iceprog
20+
icetime: icetime
21+
nextpnr-ecp5: nextpnr-ecp5
22+
nextpnr-ice40: nextpnr-ice40
23+
openocd: openocd
24+
yosys: yosys

0 commit comments

Comments
 (0)