mirror of https://github.com/openXC7/prjxray.git
Fix frame initialization regression.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
parent
4794fe574d
commit
c830c27357
|
|
@ -99,11 +99,10 @@ class FasmAssembler(object):
|
||||||
def enable_feature(self, tile, feature, address, line):
|
def enable_feature(self, tile, feature, address, line):
|
||||||
gridinfo = self.grid.gridinfo_at_tilename(tile)
|
gridinfo = self.grid.gridinfo_at_tilename(tile)
|
||||||
|
|
||||||
def update_segbit(bit):
|
def update_segbit(block_type, bit):
|
||||||
'''Set or clear a single bit in a segment at the given word column and word bit position'''
|
'''Set or clear a single bit in a segment at the given word column and word bit position'''
|
||||||
|
|
||||||
# TODO: How to determine if the feature targets BLOCK_RAM segment type?
|
bits = gridinfo.bits[block_type]
|
||||||
bits = gridinfo.bits[grid.BlockType.CLB_IO_CLK]
|
|
||||||
|
|
||||||
seg_baseaddr = bits.base_address
|
seg_baseaddr = bits.base_address
|
||||||
seg_word_base = bits.offset
|
seg_word_base = bits.offset
|
||||||
|
|
@ -125,23 +124,22 @@ class FasmAssembler(object):
|
||||||
|
|
||||||
db_k = '%s.%s' % (gridinfo.tile_type, feature)
|
db_k = '%s.%s' % (gridinfo.tile_type, feature)
|
||||||
|
|
||||||
any_bits = False
|
any_bits = set()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for bit in segbits.feature_to_bits(db_k, address):
|
for block_type, bit in segbits.feature_to_bits(db_k, address):
|
||||||
any_bits = True
|
any_bits.add(block_type)
|
||||||
update_segbit(bit)
|
update_segbit(block_type, bit)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise FasmLookupError(
|
raise FasmLookupError(
|
||||||
"Segment DB %s, key %s not found from line '%s'" %
|
"Segment DB %s, key %s not found from line '%s'" %
|
||||||
(gridinfo.tile_type, db_k, line))
|
(gridinfo.tile_type, db_k, line))
|
||||||
|
|
||||||
if any_bits:
|
for block_type in any_bits:
|
||||||
# Mark all frames used by this tile as in use.
|
# Mark all frames used by this tile as in use.
|
||||||
bits = gridinfo.bits[grid.BlockType.CLB_IO_CLK]
|
bits = gridinfo.bits[block_type]
|
||||||
if tile not in self.seen_tile:
|
for frame in range(bits.base_address, bits.base_address + bits.frames):
|
||||||
for frame in segbits.frames(bits):
|
self.frames_in_use.add(frame)
|
||||||
self.frames_in_use.add(frame)
|
|
||||||
|
|
||||||
def parse_fasm_filename(self, filename):
|
def parse_fasm_filename(self, filename):
|
||||||
missing_features = []
|
missing_features = []
|
||||||
|
|
|
||||||
|
|
@ -147,9 +147,9 @@ class TileSegbits(object):
|
||||||
for block_type in self.segbits:
|
for block_type in self.segbits:
|
||||||
if address == 0 and feature in self.segbits[block_type]:
|
if address == 0 and feature in self.segbits[block_type]:
|
||||||
for bit in self.segbits[block_type][feature]:
|
for bit in self.segbits[block_type][feature]:
|
||||||
yield bit
|
yield block_type, bit
|
||||||
return
|
return
|
||||||
|
|
||||||
block_type, feature = self.feature_addresses[feature][address]
|
block_type, feature = self.feature_addresses[feature][address]
|
||||||
for bit in self.segbits[block_type][feature]:
|
for bit in self.segbits[block_type][feature]:
|
||||||
yield bit
|
yield block_type, bit
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ def bits_to_fasm(db_root, bits_file, verbose, canonical):
|
||||||
db_k = '%s.%s' % (gridinfo.tile_type, feature)
|
db_k = '%s.%s' % (gridinfo.tile_type, feature)
|
||||||
segbits = db.get_tile_segbits(gridinfo.tile_type)
|
segbits = db.get_tile_segbits(gridinfo.tile_type)
|
||||||
any_bits = False
|
any_bits = False
|
||||||
for bit in segbits.feature_to_bits(db_k):
|
for block_type, bit in segbits.feature_to_bits(db_k):
|
||||||
if bit.isset:
|
if bit.isset:
|
||||||
any_bits = True
|
any_bits = True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue