Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified prjxray import to add tiles tags #653

Merged
merged 21 commits into from May 7, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0e73950
equivalent tiles: modified arch import to generate tiles tags
acomodi Apr 26, 2019
af46b1e
equivalent tiles: run format_python
acomodi Apr 26, 2019
7335c26
equivalent tiles: adding script to generate the tile tag
acomodi Apr 29, 2019
9fe5d81
equivalent tiles: modified cmake to have tile.xml file generation
acomodi Apr 29, 2019
0974f28
equivalent tiles: run format_python
acomodi Apr 29, 2019
100f2ed
equivalent tiles: corrected dependency issue
acomodi Apr 29, 2019
72109da
xc7/utils: added README.md
acomodi May 1, 2019
48de603
equivalent tiles: expanded comments
acomodi May 2, 2019
a0a0ee3
equivalent tiles: corrected typo in prjxray cmake
acomodi May 2, 2019
0ac832d
equivalent tiles: refactored tile tag script
acomodi May 6, 2019
c78881f
equivalent tiles: disabled equivalent tiles for CLBLs
acomodi May 6, 2019
678be16
Merge branch 'prjxray-import-add-tile-tag' of github.com:antmicro/sym…
acomodi May 6, 2019
fadd5b1
Merge remote-tracking branch 'origin/master' into prjxray-import-add-…
acomodi May 6, 2019
982a3bb
equivalent tiles: run format_python
acomodi May 6, 2019
3f1744f
Merge remote-tracking branch 'litghost/tile_split' into prjxray-impor…
acomodi May 6, 2019
3adf5d7
equivalent tiles: added SLICEL equivalent tile
acomodi May 6, 2019
47a4d82
dram: fixed assert usage in dram_8_32x1s
acomodi May 6, 2019
72e5c9d
Merge remote-tracking branch 'origin/master' into prjxray-import-add-…
acomodi May 6, 2019
a255b6b
equivalent tiles: imported tile_import functions
acomodi May 6, 2019
1d17938
equivalent tiles: corrected merge error
acomodi May 6, 2019
aca62c9
equivalent tiles: run format_python
acomodi May 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions xc7/archs/artix7/tiles/CMakeLists.txt
@@ -1,6 +1,6 @@
add_subdirectory(bram_l)
add_subdirectory(bram_r)
add_subdirectory(clbll_l)
add_subdirectory(clbll_r)
add_subdirectory(clblm_l)
add_subdirectory(clblm_r)
add_subdirectory(clbll_l)
add_subdirectory(clbll_r)
2 changes: 2 additions & 0 deletions xc7/archs/artix7/tiles/clbll_l/CMakeLists.txt
Expand Up @@ -2,4 +2,6 @@ project_xray_tile(
PART artix7
TILE CLBLL_L
SITE_TYPES SLICEL/SLICEL0 SLICEL/SLICEL1
EQUIVALENT_TILES CLBLM_L
PIN_PREFIX CLBLL_L/CLBLM_M CLBLL_LL/CLBLM_L
)
3 changes: 3 additions & 0 deletions xc7/archs/artix7/tiles/clbll_r/CMakeLists.txt
Expand Up @@ -2,4 +2,7 @@ project_xray_tile(
PART artix7
TILE CLBLL_R
SITE_TYPES SLICEL/SLICEL0 SLICEL/SLICEL1
EQUIVALENT_TILES CLBLM_R
PIN_PREFIX CLBLL_L/CLBLM_M CLBLL_LL/CLBLM_L
)

49 changes: 45 additions & 4 deletions xc7/make/project_xray.cmake
Expand Up @@ -49,7 +49,7 @@ endfunction()
function(PROJECT_XRAY_TILE)
set(options FUSED_SITES)
acomodi marked this conversation as resolved.
Show resolved Hide resolved
set(oneValueArgs PART TILE)
set(multiValueArgs SITE_TYPES)
set(multiValueArgs SITE_TYPES EQUIVALENT_TILES PIN_PREFIX)
litghost marked this conversation as resolved.
Show resolved Hide resolved
cmake_parse_arguments(
PROJECT_XRAY_TILE
"${options}"
Expand All @@ -63,7 +63,7 @@ function(PROJECT_XRAY_TILE)
get_target_property_required(PYTHON3 env PYTHON3)
get_target_property(PYTHON3_TARGET env PYTHON3_TARGET)

set(TILE_IMPORT ${symbiflow-arch-defs_SOURCE_DIR}/xc7/utils/prjxray_tile_import.py)
set(TILE_TYPE_IMPORT ${symbiflow-arch-defs_SOURCE_DIR}/xc7/utils/prjxray_tile_import.py)
acomodi marked this conversation as resolved.
Show resolved Hide resolved
get_project_xray_dependencies(DEPS ${PROJECT_XRAY_TILE_PART} ${TILE})

set(PART ${PROJECT_XRAY_TILE_PART})
Expand All @@ -89,7 +89,7 @@ function(PROJECT_XRAY_TILE)
add_custom_command(
OUTPUT ${TILE}.pb_type.xml ${TILE}.model.xml
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PRJXRAY_DIR}:${symbiflow-arch-defs_SOURCE_DIR}/utils
${PYTHON3} ${TILE_IMPORT}
${PYTHON3} ${TILE_TYPE_IMPORT}
--part ${PROJECT_XRAY_TILE_PART}
--tile ${PROJECT_XRAY_TILE_TILE}
--site_directory ${symbiflow-arch-defs_BINARY_DIR}/xc7/primitives
Expand All @@ -99,7 +99,7 @@ function(PROJECT_XRAY_TILE)
--output-model ${CMAKE_CURRENT_BINARY_DIR}/${TILE}.model.xml
${FUSED_SITES_ARGS}
DEPENDS
${TILE_IMPORT}
${TILE_TYPE_IMPORT}
acomodi marked this conversation as resolved.
Show resolved Hide resolved
${DEPS}
${PYTHON3} ${PYTHON3_TARGET} simplejson
)
Expand All @@ -117,6 +117,41 @@ function(PROJECT_XRAY_TILE)
INCLUDE_FILES "${MODEL_INCLUDE_FILES}"
LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${TILE}.model.xml
)

# tile tags
set(TILE_IMPORT ${symbiflow-arch-defs_SOURCE_DIR}/xc7/utils/prjxray_tile_type_import.py)
get_project_xray_dependencies(DEPS ${PROJECT_XRAY_TILE_PART} ${TILE})

foreach(EQUIVALENT_TILE ${PROJECT_XRAY_TILE_EQUIVALENT_TILES})
string(TOLOWER ${EQUIVALENT_TILE} EQUIVALENT_TILE_LOWER)
append_file_dependency(TILES_DEPS ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${EQUIVALENT_TILE_LOWER}/${EQUIVALENT_TILE_LOWER}.pb_type.xml)
list(APPEND EQUIVALENT_TILES_INCLUDE_FILES ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${EQUIVALENT_TILE_LOWER}/${EQUIVALENT_TILE_LOWER}.pb_type.xml)
endforeach()
append_file_dependency(TILES_DEPS ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${TILE}/${TILE}.pb_type.xml)
list(APPEND EQUIVALENT_TILES_INCLUDE_FILES ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${TILE}/${TILE}.pb_type.xml)

string(REPLACE ";" "," EQUIVALENT_TILES_COMMA "${PROJECT_XRAY_TILE_EQUIVALENT_TILES}")
string(REPLACE ";" "," PIN_PREFIX_COMMA "${PROJECT_XRAY_TILE_PIN_PREFIX}")
add_file_target(FILE ${TILE}.tile.xml GENERATED)
get_file_target(TILE_TARGET ${TILE}.tile.xml)
set_target_properties(${TILE_TARGET} PROPERTIES INCLUDE_FILES "${EQUIVALENT_TILES_INCLUDE_FILES}")

add_custom_command(
OUTPUT ${TILE}.tile.xml
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PRJXRAY_DIR}:${symbiflow-arch-defs_SOURCE_DIR}/utils
${PYTHON3} ${TILE_IMPORT}
--part ${PROJECT_XRAY_TILE_PART}
--tile ${PROJECT_XRAY_TILE_TILE}
--tiles-directory ${symbiflow-arch-defs_BINARY_DIR}/xc7/archs/${PART}/tiles
--equivalent-tiles=${EQUIVALENT_TILES_COMMA}
--pin-prefix=${PIN_PREFIX_COMMA}
--output-tile ${CMAKE_CURRENT_BINARY_DIR}/${TILE}.tile.xml
--pin_assignments ${PIN_ASSIGNMENTS}
DEPENDS
${TILE_IMPORT}
${TILES_DEPS}
${PYTHON3} ${PYTHON3_TARGET} simplejson
)
endfunction()

function(PROJECT_XRAY_ARCH)
Expand Down Expand Up @@ -147,8 +182,10 @@ function(PROJECT_XRAY_ARCH)
string(TOLOWER ${TILE_TYPE} TILE_TYPE_LOWER)
set(PB_TYPE_XML ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${TILE_TYPE_LOWER}/${TILE_TYPE_LOWER}.pb_type.xml)
set(MODEL_XML ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${TILE_TYPE_LOWER}/${TILE_TYPE_LOWER}.model.xml)
set(TILE_XML ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/tiles/${TILE_TYPE_LOWER}/${TILE_TYPE_LOWER}.tile.xml)
append_file_dependency(DEPS ${PB_TYPE_XML})
append_file_dependency(DEPS ${MODEL_XML})
append_file_dependency(DEPS ${TILE_XML})

get_file_target(PB_TYPE_TARGET ${PB_TYPE_XML})
get_target_property(INCLUDE_FILES ${PB_TYPE_TARGET} INCLUDE_FILES)
Expand All @@ -157,6 +194,10 @@ function(PROJECT_XRAY_ARCH)
get_file_target(MODEL_TARGET ${MODEL_XML})
get_target_property(INCLUDE_FILES ${MODEL_TARGET} INCLUDE_FILES)
list(APPEND ARCH_INCLUDE_FILES ${MODEL_XML} ${INCLUDE_FILES})

get_file_target(TILE_TARGET ${TILE_XML})
get_target_property(INCLUDE_FILES ${TILE_TARGET} INCLUDE_FILES)
list(APPEND ARCH_INCLUDE_FILES ${TILE_XML} ${INCLUDE_FILES})
endforeach()

set(ROI_ARG "")
Expand Down
57 changes: 49 additions & 8 deletions xc7/utils/prjxray_arch_import.py
Expand Up @@ -20,7 +20,7 @@
import lxml.etree as ET


def create_synth_io_tiles(complexblocklist_xml, pb_name, is_input):
def create_synth_io_tiles(complexblocklist_xml, tiles_xml, pb_name, is_input):
""" Creates synthetic IO pad tiles used to connect ROI inputs and outputs to the routing network.
"""
pb_xml = ET.SubElement(
Expand All @@ -38,6 +38,19 @@ def create_synth_io_tiles(complexblocklist_xml, pb_name, is_input):
}
)

tile_xml = ET.SubElement(tiles_xml, 'tile', {
'name': pb_name,
})

ET.SubElement(
tile_xml, 'fc', {
'in_type': 'abs',
'in_val': '2',
'out_type': 'abs',
'out_val': '2',
}
)

interconnect_xml = ET.SubElement(pb_xml, 'interconnect')

if is_input:
Expand Down Expand Up @@ -96,7 +109,7 @@ def create_synth_io_tiles(complexblocklist_xml, pb_name, is_input):


def create_synth_constant_tiles(
model_xml, complexblocklist_xml, pb_name, signal
model_xml, complexblocklist_xml, tiles_xml, pb_name, signal
):
""" Creates synthetic constant tile generates some constant signal.

Expand All @@ -118,6 +131,19 @@ def create_synth_constant_tiles(
}
)

tile_xml = ET.SubElement(tiles_xml, 'tile', {
'name': pb_name,
})

ET.SubElement(
tile_xml, 'fc', {
'in_type': 'abs',
'in_val': '2',
'out_type': 'abs',
'out_val': '2',
}
)

interconnect_xml = ET.SubElement(pb_xml, 'interconnect')

blif_model = '.subckt ' + signal
Expand Down Expand Up @@ -176,14 +202,18 @@ def create_synth_constant_tiles(
})


def add_synthetic_tiles(model_xml, complexblocklist_xml):
create_synth_io_tiles(complexblocklist_xml, 'SYN-INPAD', is_input=True)
create_synth_io_tiles(complexblocklist_xml, 'SYN-OUTPAD', is_input=False)
def add_synthetic_tiles(model_xml, complexblocklist_xml, tiles_xml):
create_synth_io_tiles(
complexblocklist_xml, tiles_xml, 'SYN-INPAD', is_input=True
)
create_synth_io_tiles(
complexblocklist_xml, tiles_xml, 'SYN-OUTPAD', is_input=False
)
create_synth_constant_tiles(
model_xml, complexblocklist_xml, 'SYN-VCC', 'VCC'
model_xml, complexblocklist_xml, tiles_xml, 'SYN-VCC', 'VCC'
)
create_synth_constant_tiles(
model_xml, complexblocklist_xml, 'SYN-GND', 'GND'
model_xml, complexblocklist_xml, tiles_xml, 'SYN-GND', 'GND'
)

return {
Expand Down Expand Up @@ -230,6 +260,7 @@ def main():

tile_model = "../../tiles/{0}/{0}.model.xml"
tile_pbtype = "../../tiles/{0}/{0}.pb_type.xml"
tile_tile = "../../tiles/{0}/{0}.tile.xml"

xi_url = "http://www.w3.org/2001/XInclude"
ET.register_namespace('xi', xi_url)
Expand All @@ -250,6 +281,14 @@ def main():
}
)

tiles_xml = ET.SubElement(arch_xml, 'tiles')
for tile_type in tile_types:
ET.SubElement(
tiles_xml, xi_include, {
'href': tile_tile.format(tile_type.lower()),
}
)

complexblocklist_xml = ET.SubElement(arch_xml, 'complexblocklist')
for tile_type in tile_types:
ET.SubElement(
Expand Down Expand Up @@ -292,7 +331,9 @@ def main():
y2=j['info']['GRID_Y_MAX'],
)

synth_tile_map = add_synthetic_tiles(model_xml, complexblocklist_xml)
synth_tile_map = add_synthetic_tiles(
model_xml, complexblocklist_xml, tiles_xml
)

for loc in g.tile_locations():
gridinfo = g.gridinfo_at_loc(loc)
Expand Down