Skip to content

Instantly share code, notes, and snippets.

View smunaut's full-sized avatar

Sylvain "tnt" Munaut smunaut

View GitHub Profile
@smunaut
smunaut / README.md
Last active January 26, 2021 21:13
CodeRender

Render code to image

Place wkhtmltoimage static build in this directory

@smunaut
smunaut / ice40-opt-cset.py
Last active October 3, 2020 20:00
iCE40 Control Set optimization
#!/usr/bin/env python3
from collections import namedtuple
#
# TODO: When evaluating cost and wiring stuff, if the signal of the control set
# happen to be already existing on the LUT, it could be used ...
#
@smunaut
smunaut / ice40-usage.py
Created September 26, 2020 15:19
Simple usage script for nextpnr-ice40 pre-place step
#!/usr/bin/env python3
CELLS = {
'ICESTORM_LC': ( 'LC', 5),
'ICESTORM_RAM': ( 'RAM', 2),
'ICESTORM_DSP': ( 'DSP', 1),
'ICESTORM_SPRAM': ('SPRAM', 1),
}
@smunaut
smunaut / ice40_global.md
Last active May 5, 2020 14:18
iCE40 Global Networks

UP5k SG48:

ID Use SB_IO_GB SB_GB Special
x/y/z (pin) x/y x/y type
0 Clk / Reset 19/ 0/1 (20) 13/ 0
1 Clk / CE 6/ 0/1 (44) 13/31
2 Clk / Reset 13/31/0 (37) 19/31 12/31 PLL_B
3 Clk / CE 6/31
@smunaut
smunaut / gtkwave-sigrok-filter.py
Last active January 18, 2024 18:37
Transaction Filter Process for GTKWave to run SigRok protocol decoders
#!/usr/bin/env python3
"""
gtkwave-sigrok-filter.py
Use as a 'Transaction Filter Process' in gtkwave to apply signal
Usage:
- Group input signals in gtkwave with F4
- Apply this script as a 'Transaction Filter Process' (Right click / Data Format)