Merge pull request #160 from mcmasterg/addtag

fuzzers: fix addtag regression
This commit is contained in:
John Mcmaster 2018-10-17 20:44:51 -07:00 committed by GitHub
commit cbc7e23d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 49 additions and 47 deletions

View File

@ -92,29 +92,29 @@ with open("design.txt", "r") as f:
is5 = '5' in ff_name
if used:
segmk.addtag(site, "%s.ZINI" % ff_name, 1 ^ init)
segmk.add_site_tag(site, "%s.ZINI" % ff_name, 1 ^ init)
# CLKINV turns out to be more complicated than origianlly thought
if isff(cel_prim):
segmk.addtag(site, "CLKINV", cinv)
segmk.add_site_tag(site, "CLKINV", cinv)
else:
segmk.addtag(site, "CLKINV", 1 ^ cinv)
segmk.add_site_tag(site, "CLKINV", 1 ^ cinv)
# Synchronous vs asynchronous FF
# Unlike most bits, shared between all CLB FFs
segmk.addtag(site, "FFSYNC", cel_prim in ('FDSE', 'FDRE'))
segmk.add_site_tag(site, "FFSYNC", cel_prim in ('FDSE', 'FDRE'))
# Latch bit
# Only applies to LUT6 (non-5) FF's
if not is5:
segmk.addtag(site, "LATCH", isl(cel_prim))
segmk.add_site_tag(site, "LATCH", isl(cel_prim))
'''
On name:
The primitives you listed have a control input to set the FF value to zero (clear/reset),
the other three primitives have a control input that sets the FF value to one.
Z => inversion
'''
segmk.addtag(
segmk.add_site_tag(
site, "%s.ZRST" % ff_name,
cel_prim in ('FDRE', 'FDCE', 'LDCE'))

View File

@ -26,7 +26,7 @@ for l in f:
# Theory: there is one bit for each mux positon
# In each config 3 muxes are in one position, other 3 are in another
inv = int(i == n)
segmk.addtag(loc, "%c5FFMUX.IN_A" % which, def_a ^ inv)
segmk.addtag(loc, "%c5FFMUX.IN_B" % which, 1 ^ def_a ^ inv)
segmk.add_site_tag(loc, "%c5FFMUX.IN_A" % which, def_a ^ inv)
segmk.add_site_tag(loc, "%c5FFMUX.IN_B" % which, 1 ^ def_a ^ inv)
segmk.compile()
segmk.write()

View File

@ -23,6 +23,6 @@ for l in f:
which = bel[0]
# One bit, set on O5
segmk.addtag(loc, "CARRY4.%cCY0" % which, module == 'clb_NCY0_O5')
segmk.add_site_tag(loc, "CARRY4.%cCY0" % which, module == 'clb_NCY0_O5')
segmk.compile()
segmk.write()

View File

@ -26,7 +26,7 @@ for l in f:
# parameter nFORCE_R0=1;
# .CE(din[0] | FORCE_CE1),
# .R(din[1] & nFORCE_R0),
segmk.addtag(site, "CEUSEDMUX", ce ^ 1)
segmk.addtag(site, "SRUSEDMUX", r)
segmk.add_site_tag(site, "CEUSEDMUX", ce ^ 1)
segmk.add_site_tag(site, "SRUSEDMUX", r)
segmk.compile()
segmk.write()

View File

@ -53,7 +53,7 @@ for l in f:
# add the 1-tag for this connection
tag = "%sFFMUX.%s" % (which, src)
segmk.addtag(loc, tag, 1)
segmk.add_site_tag(loc, tag, 1)
# remove this MUX from the cache, preventing generation of 0-tags for this MUX
cache[loc].remove(which)
@ -66,7 +66,7 @@ for loc, muxes in cache.items():
if src == "F8" and which not in "B": continue
if src == "AX": src = which + "X"
tag = "%sFFMUX.%s" % (which, src)
segmk.addtag(loc, tag, 0)
segmk.add_site_tag(loc, tag, 0)
# we know that all bits for those MUXes are in frames 30 and 31, so filter all other bits

View File

@ -53,7 +53,7 @@ for l in f:
# add the 1-tag for this connection
tag = "%sOUTMUX.%s" % (which, src)
segmk.addtag(loc, tag, 1)
segmk.add_site_tag(loc, tag, 1)
# remove this MUX from the cache, preventing generation of 0-tags for this MUX
cache[loc].remove(which)
@ -66,7 +66,7 @@ for loc, muxes in cache.items():
if src == "F8" and which not in "B": continue
if src == "5Q": src = which + "5Q"
tag = "%sOUTMUX.%s" % (which, src)
segmk.addtag(loc, tag, 0)
segmk.add_site_tag(loc, tag, 0)
def bitfilter(frame_idx, bit_idx):

View File

@ -24,7 +24,7 @@ for l in f:
'''
srcs = ('0', '1', 'AX', 'CIN')
for asrc in srcs:
segmk.addtag(loc, "PRECYINIT.%s" % asrc, int(src == asrc))
segmk.add_site_tag(loc, "PRECYINIT.%s" % asrc, int(src == asrc))
segmk.compile()
segmk.write()

View File

@ -40,10 +40,10 @@ for l in f:
l = l.strip()
module, loc, p0, p1, p2, p3 = l.split(',')
segmk.addtag(
segmk.add_site_tag(
loc, "WA7USED",
module in ('my_RAM128X1D', 'my_RAM128X1S', 'my_RAM256X1S'))
segmk.addtag(loc, "WA8USED", module == 'my_RAM256X1S')
segmk.add_site_tag(loc, "WA8USED", module == 'my_RAM256X1S')
# (a, b, c, d)
# Size set for RAM32X1S, RAM32X1D, and SRL16E
@ -59,7 +59,8 @@ for l in f:
# Clock Enable (CE) clock gate only enabled if we have clocked elements
# A pure LUT6 does not, but everything else should
segmk.addtag(loc, "WEMUX.CE", bels != ['LUT6', 'LUT6', 'LUT6', 'LUT6'])
segmk.add_site_tag(
loc, "WEMUX.CE", bels != ['LUT6', 'LUT6', 'LUT6', 'LUT6'])
beli = 0
for which, bel in zip('ABCD', bels):
@ -123,10 +124,10 @@ for l in f:
# Now commit bits after marking 1's
for beli, bel in enumerate('ABCD'):
segmk.addtag(loc, "%sLUT.RAM" % bel, ram[beli])
segmk.addtag(loc, "%sLUT.SRL" % bel, srl[beli])
segmk.add_site_tag(loc, "%sLUT.RAM" % bel, ram[beli])
segmk.add_site_tag(loc, "%sLUT.SRL" % bel, srl[beli])
# FIXME
module == segmk.addtag(loc, "%sLUT.SMALL" % bel, size[beli])
module == segmk.add_site_tag(loc, "%sLUT.SMALL" % bel, size[beli])
def bitfilter(frame_idx, bit_idx):

View File

@ -27,9 +27,9 @@ for l in f:
c31 = int(c31)
b31 = int(b31)
a31 = int(a31)
segmk.addtag(loc, "ADI1MUX.AI", 1 ^ a31)
segmk.addtag(loc, "BDI1MUX.BI", 1 ^ b31)
segmk.addtag(loc, "CDI1MUX.CI", 1 ^ c31)
segmk.add_site_tag(loc, "ADI1MUX.AI", 1 ^ a31)
segmk.add_site_tag(loc, "BDI1MUX.BI", 1 ^ b31)
segmk.add_site_tag(loc, "CDI1MUX.CI", 1 ^ c31)
segmk.compile()
segmk.write()

View File

@ -53,9 +53,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
segmk.compile()
segmk.write()

View File

@ -53,9 +53,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
def bitfilter(frame_idx, bit_idx):

View File

@ -50,9 +50,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
def bitfilter(frame_idx, bit_idx):

View File

@ -50,9 +50,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
def bitfilter(frame_idx, bit_idx):

View File

@ -50,9 +50,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
segmk.compile()
segmk.write()

View File

@ -50,9 +50,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
segmk.compile()
segmk.write()

View File

@ -60,9 +60,9 @@ for tile, pips_srcs_dsts in tiledata.items():
if pip in ignpip:
pass
elif pip in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif src_dst[1] not in dsts:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
segmk.compile()
segmk.write()

View File

@ -36,9 +36,9 @@ for tile, pips_nodes in tiledata.items():
for dst, src in pipdata:
if (dst, src) in pips:
segmk.addtag(tile, "%s.%s" % (dst, src), 1)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 1)
elif dst not in nodes and src not in nodes:
segmk.addtag(tile, "%s.%s" % (dst, src), 0)
segmk.add_tile_tag(tile, "%s.%s" % (dst, src), 0)
def bitfilter(frame_idx, bit_idx):

View File

@ -37,16 +37,16 @@ for arg in sys.argv[1:]:
tile_type, pip = pip.split(".")
src, dst = pip.split("->>")
tag = "%s.%s" % (dst, src)
segmk.addtag(tile, tag, 1)
segmk.add_tile_tag(tile, tag, 1)
if "HCLK_CK_BUFH" in src:
en_tag = "ENABLE_BUFFER.%s" % src
segmk.addtag(tile, en_tag, 1)
segmk.add_tile_tag(tile, en_tag, 1)
for tag, tag_dst in tags.items():
if tag_dst != dst:
segmk.addtag(tile, tag, 0)
segmk.add_tile_tag(tile, tag, 0)
for en_tag, en_tag_src in en_tags.items():
if en_tag_src != src:
segmk.addtag(tile, en_tag, 0)
segmk.add_tile_tag(tile, en_tag, 0)
segmk.compile()
segmk.write(arg)

View File

@ -20,8 +20,9 @@ with open("design_%s.txt" % sys.argv[1], "r") as f:
pattern = int(pattern.replace("48'h", ""), 16)
for i in range(48):
segmk.addtag(tile, "%s.MASK[%d]" % (dsp, i), (mask >> i) & 1)
segmk.addtag(tile, "%s.PATTERN[%d]" % (dsp, i), (pattern >> i) & 1)
segmk.add_tile_tag(tile, "%s.MASK[%d]" % (dsp, i), (mask >> i) & 1)
segmk.add_tile_tag(
tile, "%s.PATTERN[%d]" % (dsp, i), (pattern >> i) & 1)
segmk.compile()
segmk.write(suffix=sys.argv[1])