Skip to content

Commit

Permalink
TMRG and VIVADO fix (#100)
Browse files Browse the repository at this point in the history
Co-authored-by: Benoit Denkinger <[email protected]>
  • Loading branch information
benoitdenkinger and Benoit Denkinger authored Nov 15, 2024
1 parent 38faa1b commit fec973f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
19 changes: 16 additions & 3 deletions cmake/fpga/vivado/edalize_vivado.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from edalize import get_edatool
import argparse
from typing import List
import os
import sys

def main(
rtl_files: List[str],
Expand Down Expand Up @@ -31,7 +31,20 @@ def main(
param = define.split('=')
p_name = param[0]
type = 'str'
params[p_name] = {'datatype' : type, 'default' : param[1], 'paramtype' : 'vlogdefine'}
# Check param list length:
# len=1: parameter of type MY_DEFINE
# len=2: parameter of type MY_DEFINE=MYVALUE
# len>2: error
param_len = len(param)
# by default params are set to one if no value is given
param_value = '1'
if (param_len == 1):
print(f"edalize_vivado.py - Warning: define {p_name} is assigned the default value of 1")
elif (param_len == 2):
param_value = param[1]
else:
print(f"edalize_vivado - Fatal error: define {p_name} syntax is wrong: {define}", file=sys.stderr)
params[p_name] = {'datatype' : type, 'default' : param_value, 'paramtype' : 'vlogdefine'}

tool = 'vivado'

Expand Down Expand Up @@ -74,6 +87,6 @@ def main(
name=args.name,
top=args.top,
outdir=args.outdir,
)
)


5 changes: 2 additions & 3 deletions cmake/tmrg/tmrg/tmrg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ function(tmrg IP_LIB)

# Get all the IP sources (ip+dependencies)
get_ip_rtl_sources(IP_SRC_ALL ${IP_LIB})
# Get only the IP sources (not the dependencies)
get_ip_rtl_sources(IP_SRC ${IP_LIB} NO_DEPS)

# Only the IP sources (not the dependencies) are triplicated
# The dependency sources are passed as libraries and it's up
Expand All @@ -73,8 +71,9 @@ function(tmrg IP_LIB)
set(SRC_DEPS)
# Find the deps sources only
foreach(file ${IP_SRC_ALL})
list(FIND IP_SRC ${file} index)
list(FIND IP_TMRG_SRC ${file} index)
if(index EQUAL -1)
# If the file is not in IP_TMRG_SRC, had it to SRC_DEPS
list(APPEND SRC_DEPS ${file})
endif()
endforeach()
Expand Down

0 comments on commit fec973f

Please sign in to comment.