Skip to content

Commit

Permalink
Socgen props (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
mksoc authored Oct 30, 2024
1 parent cc933ff commit 12225ec
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 2 deletions.
7 changes: 7 additions & 0 deletions cmake/firmware/linker_script/gen_lds.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ function(gen_lds IP_LIB)
# Get the system RDL files for the IP library
get_ip_sources(RDL_FILES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
endif()

# Check if system RDL files exist
if(NOT RDL_FILES)
message(FATAL_ERROR "Library ${IP_LIB} does not have RDL_FILES property set, unable to run ${CMAKE_CURRENT_FUNCTION}")
Expand All @@ -76,6 +82,7 @@ function(gen_lds IP_LIB)
OUTPUT ${LDS_FILE} ${STAMP_FILE}
COMMAND ${Python3_EXECUTABLE} ${LDS_GEN_TOOL}
--rdlfiles ${RDL_FILES}
${INCDIR_ARG}
--outfile ${LDS_FILE}
${ARG_NODEBUG}
${OVERWRITTEN_PARAMETERS}
Expand Down
9 changes: 8 additions & 1 deletion cmake/firmware/linker_script/src/gen_linker_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ def main():
parser.add_argument('--outfile', required=True, help='Output lds file')
parser.add_argument('--debug', default=False, action="store_true", help='Include debug section in the lds or discard it')
parser.add_argument('-p', '--param', nargs='+', help="Parameter to overwrite on top RDL module in the format 'PARAM=VALUE'")
parser.add_argument(
"-I",
dest="incdirs",
metavar="INCDIR",
action="append",
help='Search directory for files included with `include "filename"',
)

args = parser.parse_args()

Expand All @@ -187,7 +194,7 @@ def main():

try:
for input_file in args.rdlfiles:
rdlc.compile_file(input_file)
rdlc.compile_file(input_file, incl_search_paths=args.incdirs,)
root = rdlc.elaborate(parameters=overwritten_params_dict)
except RDLCompileError:
sys.exit(1)
Expand Down
7 changes: 7 additions & 0 deletions cmake/peakrdl/peakrdl_docusaurus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ function(peakrdl_docusaurus IP_LIB)

get_ip_sources(RDL_FILES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
endif()

if(NOT RDL_FILES)
message(FATAL_ERROR "Library ${IP_LIB} does not have RDL_FILES property set,
unable to run ${CMAKE_CURRENT_FUNCTION}")
Expand All @@ -38,6 +44,7 @@ function(peakrdl_docusaurus IP_LIB)
find_python3()
set(__CMD
${Python3_EXECUTABLE} -m peakrdl docusaurus
${INCDIR_ARG}
-o ${OUTDIR}
${RDL_FILES}
${_ARG_SIDEBAR_TEMPLATE}
Expand Down
8 changes: 7 additions & 1 deletion cmake/peakrdl/peakrdl_halcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ function(peakrdl_halcpp IP_LIB)

get_ip_sources(RDL_FILES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
endif()

__ext_header_provided(${IP_LIB} libs)
list(LENGTH libs libs_len)
if(libs_len GREATER 0)
Expand All @@ -83,7 +89,7 @@ function(peakrdl_halcpp IP_LIB)

find_python3()
set(__CMD ${Python3_EXECUTABLE} -m peakrdl halcpp
${RDL_FILES} ${EXT_ARG} ${SKIB_BUSES_ARG} -o ${OUTDIR} ${OVERWRITTEN_PARAMETERS}
${RDL_FILES} ${EXT_ARG} ${SKIB_BUSES_ARG} ${INCDIR_ARG} -o ${OUTDIR} ${OVERWRITTEN_PARAMETERS}
)

target_include_directories(${IP_LIB} INTERFACE ${OUTDIR} ${OUTDIR}/include)
Expand Down
7 changes: 7 additions & 0 deletions cmake/peakrdl/peakrdl_regblock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ function(peakrdl_regblock IP_LIB)
# This function gets the IP sources and the deps
get_ip_sources(RDL_SOURCES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
endif()

if(NOT RDL_SOURCES)
message(FATAL_ERROR "Library ${IP_LIB} does not have SYSTEMRDL_SOURCES property set,
unable to run ${CMAKE_CURRENT_FUNCTION}")
Expand All @@ -91,6 +97,7 @@ function(peakrdl_regblock IP_LIB)
--rename ${REGBLOCK_NAME}
${INTF_ARG}
${RESET_ARG}
${INCDIR_ARG}
-o ${OUTDIR}
${RDL_SOURCES}
)
Expand Down
7 changes: 7 additions & 0 deletions cmake/peakrdl/peakrdl_regblock_wrap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ function(peakrdl_regblock_wrap IP_LIB)
# This function gets the IP sources and the deps
get_ip_sources(RDL_SOURCES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
endif()

if(NOT RDL_SOURCES)
message(FATAL_ERROR "Library ${IP_LIB} does not have SYSTEMRDL_SOURCES property set,
unable to run ${CMAKE_CURRENT_FUNCTION}")
Expand All @@ -76,6 +82,7 @@ function(peakrdl_regblock_wrap IP_LIB)
${INTF_ARG}
${RESET_ARG}
${TMR_OPT}
${INCDIR_ARG}
-o ${OUTDIR}
${RDL_SOURCES}
)
Expand Down
9 changes: 9 additions & 0 deletions cmake/peakrdl/peakrdl_socgen/common/socgen_props.rdl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ property datatype {
component = signal;
};

// For IPs that have a regblock_wrap target, bind this property
// to signals that are only used within the wrapper and are not
// ports of the core logic.
property wrap_only {
type = boolean;
default=true;
component = signal;
};

property master {
type = boolean;
component = addrmap;
Expand Down
7 changes: 7 additions & 0 deletions cmake/peakrdl/peakrdl_socgen/peakrdl_socgen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ function(peakrdl_socgen IP_LIB)
get_ip_sources(RDL_SOCGEN_GLUE ${IP_LIB} SYSTEMRDL_SOCGEN)
get_ip_sources(SYSTEMRDL_SOURCES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
endif()

if(NOT SYSTEMRDL_SOURCES)
message(FATAL_ERROR "Library ${IP_LIB} does not have SYSTEMRDL_SOURCES property set,
unable to run ${CMAKE_CURRENT_FUNCTION}")
Expand All @@ -122,6 +128,7 @@ function(peakrdl_socgen IP_LIB)
set(__CMD
${Python3_EXECUTABLE} -m peakrdl socgen
--intfs ${RDL_SOCGEN_GLUE}
${INCDIR_ARG}
-o ${OUTDIR}
${SYSTEMRDL_SOURCES}
${ARG_USE_INCLUDE}
Expand Down

0 comments on commit 12225ec

Please sign in to comment.