forked from f4pga/prjxray
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request f4pga#727 from litghost/bufmrce
Solve remaining bits in the ROI
- Loading branch information
Showing
35 changed files
with
2,330 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
N ?= 5 | ||
GENERATE_ARGS?="--oneval 1 --design params.csv --dword 1 --dframe 1A" | ||
GENERATE_ARGS?="--oneval 1 --design params.csv --dword 6 --dframe 1A" | ||
include ../fuzzaddr/common.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
N ?= 5 | ||
GENERATE_ARGS?="--oneval 1 --design params.csv --dword 5 --dframe 1C" | ||
include ../fuzzaddr/common.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "$::env(XRAY_DIR)/utils/utils.tcl" | ||
|
||
generate_top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import os | ||
import random | ||
random.seed(int(os.getenv("SEED"), 16)) | ||
from prjxray import util | ||
from prjxray.db import Database | ||
|
||
|
||
def gen_sites(): | ||
db = Database(util.get_db_root()) | ||
grid = db.grid() | ||
for tile_name in sorted(grid.tiles()): | ||
loc = grid.loc_of_tilename(tile_name) | ||
gridinfo = grid.gridinfo_at_loc(loc) | ||
sites = [] | ||
for site, site_type in gridinfo.sites.items(): | ||
if site_type == 'BUFMRCE': | ||
sites.append(site) | ||
|
||
if sites: | ||
yield tile_name, sorted(sites) | ||
|
||
|
||
def write_params(params): | ||
pinstr = 'tile,val,site\n' | ||
for tile, (site, val) in sorted(params.items()): | ||
pinstr += '%s,%s,%s\n' % (tile, val, site) | ||
open('params.csv', 'w').write(pinstr) | ||
|
||
|
||
def run(): | ||
print(''' | ||
module top(); | ||
''') | ||
|
||
params = {} | ||
|
||
sites = list(gen_sites()) | ||
for (tile_name, sites), isone in zip(sites, | ||
util.gen_fuzz_states(len(sites))): | ||
site_name = sites[0] | ||
params[tile_name] = (site_name, isone) | ||
|
||
print( | ||
''' | ||
wire clk_{site}; | ||
(* KEEP, DONT_TOUCH, LOC = "{site}" *) | ||
BUFMRCE #( | ||
.INIT_OUT({isone}) | ||
) buf_{site} ( | ||
.O(clk_{site}) | ||
); | ||
BUFR bufr_{site} ( | ||
.I(clk_{site}) | ||
); | ||
'''.format( | ||
site=site_name, | ||
isone=isone, | ||
)) | ||
|
||
print("endmodule") | ||
write_params(params) | ||
|
||
|
||
if __name__ == '__main__': | ||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,62 @@ | ||
export FUZDIR=$(shell pwd) | ||
PIP_TYPE?=clk_hrow_bot | ||
PIP_TYPE?=clk_hrow | ||
PIPLIST_TCL=$(FUZDIR)/clk_hrow_pip_list.tcl | ||
|
||
ifeq (${XRAY_PART}, xc7z010clg400-1) | ||
# xc7z010clg400-1 is missing some side clock connections, so these bits cannot | ||
# be documented. | ||
TODO_RE="[^\.]+\.CLK_HROW_CK_MUX_OUT_[LR][0-9]+\.CLK_HROW_.*[KR_][0-9]+" | ||
else | ||
TODO_RE="[^\.]+\.CLK_HROW_CK_MUX_OUT_" | ||
endif | ||
TODO_RE=".*" | ||
|
||
MAKETODO_FLAGS=--no-l --pip-type ${PIP_TYPE} --seg-type clk_hrow_bot --re $(TODO_RE) | ||
MAKETODO_FLAGS=--sides "bot_r,top_r" --pip-type ${PIP_TYPE} --seg-type clk_hrow --re $(TODO_RE) | ||
N = 50 | ||
|
||
# These PIPs all appear to be either a 1 bit solutions. | ||
SEGMATCH_FLAGS=-c 1 | ||
# These PIPs all appear to be either a 2 bit solutions. | ||
SEGMATCH_FLAGS=-c 2 | ||
SPECIMENS_DEPS=build/cmt_regions.csv | ||
A_PIPLIST=clk_hrow_bot_r.txt | ||
|
||
include ../pip_loop.mk | ||
|
||
database: build/segbits_clk_hrow.db | ||
database: build/segbits_clk_hrow_bot_r.rdb build/segbits_clk_hrow_top_r.rdb | ||
${XRAY_DBFIXUP} --db-root build --zero-db bits.dbf \ | ||
--seg-fn-in build/segbits_clk_hrow_top_r.rdb \ | ||
--seg-fn-out build/segbits_clk_hrow_top_r.db | ||
${XRAY_DBFIXUP} --db-root build --zero-db bits.dbf \ | ||
--seg-fn-in build/segbits_clk_hrow_bot_r.rdb \ | ||
--seg-fn-out build/segbits_clk_hrow_bot_r.db | ||
|
||
build/cmt_regions.csv: output_cmt.tcl | ||
mkdir -p build | ||
cd build/ && ${XRAY_VIVADO} -mode batch -source ${FUZDIR}/output_cmt.tcl | ||
# Keep a copy to track iter progress | ||
cp build/segbits_clk_hrow_top_r.rdb build/$(ITER)/segbits_clk_hrow_top_r.rdb | ||
cp build/segbits_clk_hrow_bot_r.rdb build/$(ITER)/segbits_clk_hrow_bot_r.rdb | ||
|
||
build/segbits_clk_hrow.rdb: $(SPECIMENS_OK) | ||
${XRAY_SEGMATCH} ${SEGMATCH_FLAGS} -o build/segbits_clk_hrow.rdb \ | ||
$(shell find build -name segdata_clk_hrow_top_r.txt) \ | ||
${XRAY_MASKMERGE} build/mask_clk_hrow_top_r.db \ | ||
$(shell find build -name segdata_clk_hrow_top_r.txt) | ||
${XRAY_MASKMERGE} build/mask_clk_hrow_bot_r.db \ | ||
$(shell find build -name segdata_clk_hrow_bot_r.txt) | ||
|
||
build/segbits_clk_hrow.db: build/segbits_clk_hrow.rdb piplist | ||
${XRAY_DBFIXUP} --db-root build --zero-db bits.dbf \ | ||
--seg-fn-in build/segbits_clk_hrow.rdb \ | ||
--seg-fn-out build/segbits_clk_hrow_rc.db | ||
# Clobber existing .db to eliminate potential conflicts | ||
rm -f build/database/${XRAY_DATABASE}/* | ||
cp ${XRAY_DATABASE_DIR}/${XRAY_DATABASE}/segbits*.db build/database/${XRAY_DATABASE} | ||
XRAY_DATABASE_DIR=${FUZDIR}/build/database ${XRAY_MERGEDB} clk_hrow_bot_r build/segbits_clk_hrow_bot_r.db | ||
XRAY_DATABASE_DIR=${FUZDIR}/build/database ${XRAY_MERGEDB} clk_hrow_top_r build/segbits_clk_hrow_top_r.db | ||
|
||
# Convert row/column into PIP definition. | ||
python3 merge_clk_entries.py \ | ||
build/segbits_clk_hrow_rc.db \ | ||
$(XRAY_FUZZERS_DIR)/piplist/build/${PIP_TYPE}/clk_hrow_bot_r.txt \ | ||
build/segbits_clk_hrow.db | ||
build/cmt_regions.csv: output_cmt.tcl | ||
mkdir -p build | ||
cd build/ && ${XRAY_VIVADO} -mode batch -source ${FUZDIR}/output_cmt.tcl | ||
|
||
# Keep a copy to track iter progress | ||
cp build/segbits_clk_hrow.rdb build/$(ITER)/segbits_clk_hrow.rdb | ||
cp build/segbits_clk_hrow_rc.db build/$(ITER)/segbits_clk_hrow_rc.db | ||
generate: $(SPECIMENS_OK) | ||
|
||
build/segbits_clk_hrow_top_r.rdb: $(SPECIMENS_OK) | ||
${XRAY_SEGMATCH} ${SEGMATCH_FLAGS} -o build/segbits_clk_hrow_top_r.rdb \ | ||
$(shell find build -name segdata_clk_hrow_top_r.txt) | ||
|
||
${XRAY_MASKMERGE} build/mask_clk_hrow.db \ | ||
$(shell find build -name segdata_clk_hrow_top_r.txt) \ | ||
build/segbits_clk_hrow_bot_r.rdb: $(SPECIMENS_OK) | ||
${XRAY_SEGMATCH} ${SEGMATCH_FLAGS} -o build/segbits_clk_hrow_bot_r.rdb \ | ||
$(shell find build -name segdata_clk_hrow_bot_r.txt) | ||
|
||
# Clobber existing .db to eliminate potential conflicts | ||
cp ${XRAY_DATABASE_DIR}/${XRAY_DATABASE}/segbits*.db build/database/${XRAY_DATABASE} | ||
XRAY_DATABASE_DIR=${FUZDIR}/build/database ${XRAY_MERGEDB} clk_hrow_bot_r build/segbits_clk_hrow.db | ||
XRAY_DATABASE_DIR=${FUZDIR}/build/database ${XRAY_MERGEDB} clk_hrow_top_r build/segbits_clk_hrow.db | ||
build/segbits_clk_hrow.db: build/segbits_clk_hrow_top_.rdb | ||
|
||
pushdb: database | ||
${XRAY_MERGEDB} clk_hrow_bot_r build/segbits_clk_hrow.db | ||
${XRAY_MERGEDB} clk_hrow_top_r build/segbits_clk_hrow.db | ||
${XRAY_MERGEDB} mask_clk_hrow_bot_r build/mask_clk_hrow.db | ||
${XRAY_MERGEDB} mask_clk_hrow_top_r build/mask_clk_hrow.db | ||
${XRAY_MERGEDB} clk_hrow_bot_r build/segbits_clk_hrow_bot_r.db | ||
${XRAY_MERGEDB} clk_hrow_top_r build/segbits_clk_hrow_top_r.db | ||
${XRAY_MERGEDB} mask_clk_hrow_bot_r build/mask_clk_hrow_bot_r.db | ||
${XRAY_MERGEDB} mask_clk_hrow_top_r build/mask_clk_hrow_top_r.db | ||
|
||
.PHONY: database pushdb | ||
.PHONY: database pushdb generate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.