aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-07-03 20:46:05 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-07-03 20:46:05 +0200
commitfd3c124f8738de3cbd380906b70135fad8c09d87 (patch)
treeca4baf33e7d72af074abec4f25069579b2d9061a /ice40
parent1a8b4591f56a2e62a601a32508f3d49ae0c7f112 (diff)
downloadnextpnr-fd3c124f8738de3cbd380906b70135fad8c09d87.tar.gz
nextpnr-fd3c124f8738de3cbd380906b70135fad8c09d87.tar.bz2
nextpnr-fd3c124f8738de3cbd380906b70135fad8c09d87.zip
Add opetion to defie ICEBOX_ROOT, fix compile on other location
Diffstat (limited to 'ice40')
-rw-r--r--ice40/chipdb.py3
-rw-r--r--ice40/family.cmake6
2 files changed, 6 insertions, 3 deletions
diff --git a/ice40/chipdb.py b/ice40/chipdb.py
index 8a1c9ce2..931c73d1 100644
--- a/ice40/chipdb.py
+++ b/ice40/chipdb.py
@@ -10,6 +10,7 @@ group = parser.add_mutually_exclusive_group()
group.add_argument("-b", "--binary", action="store_true")
group.add_argument("-c", "--c_file", action="store_true")
parser.add_argument("filename", type=str, help="chipdb input filename")
+parser.add_argument("-p", "--portspins", type=str, help="path to portpins.inc")
args = parser.parse_args()
endianness = "le"
@@ -53,7 +54,7 @@ beltypes = dict()
tiletypes = dict()
wiretypes = dict()
-with open("ice40/portpins.inc") as f:
+with open(args.portspins) as f:
for line in f:
line = line.replace("(", " ")
line = line.replace(")", " ")
diff --git a/ice40/family.cmake b/ice40/family.cmake
index 532d7cc4..ad9fac44 100644
--- a/ice40/family.cmake
+++ b/ice40/family.cmake
@@ -13,11 +13,13 @@ add_library(ice40_chipdb OBJECT ice40/chipdbs/)
target_compile_options(ice40_chipdb PRIVATE -g0 -O0 -w)
target_compile_definitions(ice40_chipdb PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family})
target_include_directories(ice40_chipdb PRIVATE ${family}/)
+set(ICEBOX_ROOT "/usr/local/share/icebox" CACHE STRING "icebox location root")
foreach (dev ${devices})
- set(DEV_TXT_DB /usr/local/share/icebox/chipdb-${dev}.txt)
+ set(DEV_TXT_DB ${ICEBOX_ROOT}/chipdb-${dev}.txt)
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.cc)
+ set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc)
add_custom_command(OUTPUT ${DEV_CC_DB}
- COMMAND python3 ${DB_PY} -c ${DEV_TXT_DB} > ${DEV_CC_DB}.new
+ COMMAND python3 ${DB_PY} -c -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB}.new
COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
DEPENDS ${DEV_TXT_DB} ${DB_PY}
)