Skip to content

Commit

Permalink
Add information about the functions of the pins.o (#135)
Browse files Browse the repository at this point in the history
Includes information on additional pin functions such as RPLL_C_IN,
GCLKC_3, SCLK and others.
This allows a decision to be made about special network routing of such
pins

Signed-off-by: YRabbit <[email protected]>

Signed-off-by: YRabbit <[email protected]>
  • Loading branch information
yrabbit authored Dec 1, 2022
1 parent bbd4b3d commit 368e518
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apycula/chipdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class Device:
grid: List[List[Tile]] = field(default_factory=list)
timing: Dict[str, Dict[str, List[float]]] = field(default_factory=dict)
packages: Dict[str, Tuple[str, str, str]] = field(default_factory=dict)
pinout: Dict[str, Dict[str, Dict[str, str]]] = field(default_factory=dict)
# {variant: {package: {pin#: (pin_name, [cfgs])}}}
pinout: Dict[str, Dict[str, Dict[str, Tuple[str, List[str]]]]] = field(default_factory=dict)
pin_bank: Dict[str, int] = field(default_factory = dict)
cmd_hdr: List[ByteString] = field(default_factory=list)
cmd_ftr: List[ByteString] = field(default_factory=list)
Expand Down
10 changes: 8 additions & 2 deletions apycula/gowin_bba.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,15 @@ def write_pinout(b, db):
for pkg, pins in pkgs.items():
b.u32(id_string(pkg))
with b.block("pins") as pinblk:
for num, loc in pins.items():
for num, loccfg in pins.items():
loc, cfgs = loccfg
b.u16(id_string(num))
b.u16(id_string(iob2bel(db, loc)))
with b.block("cfgs") as cfgblk:
for cfg in cfgs:
b.u32(id_string(cfg))
b.u32(len(cfgs))
b.ref(cfgblk)
b.u32(len(pins))
b.ref(pinblk)
b.u32(len(pkgs))
Expand All @@ -197,7 +203,7 @@ def write_chipdb(db, f, device):
b.pre('NEXTPNR_NAMESPACE_BEGIN')
with b.block(f'chipdb_{cdev}') as blk:
b.str(device)
b.u32(1) # version
b.u32(2) # version
b.u16(db.rows)
b.u16(db.cols)
write_grid(b, db.grid)
Expand Down
5 changes: 4 additions & 1 deletion apycula/pindef.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ def get_pin_locs(device, package, special_pins=False):
df = get_package(device, package, special_pins)
res = {}
for pin in df:
res[str(pin['INDEX'])] = pin['NAME']
cfgs = []
if 'CFG' in pin.keys():
cfgs = pin['CFG'].split('/')
res[str(pin['INDEX'])] = (pin['NAME'], cfgs)
return res

def get_clock_locs(device, package):
Expand Down

0 comments on commit 368e518

Please sign in to comment.