Skip to content

Commit

Permalink
Peakrdl params (#108)
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 Dec 9, 2024
1 parent 244f009 commit 6d5f934
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
3 changes: 3 additions & 0 deletions cmake/fpga/uart_programmer/uart_programmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ def program(
if not sync_f:
# Wait for the first similar byte
while not sync_f:
print(f"INFO: Waiting for synchronization... ", end="")
rbyte = ser.read(1)
print(f"Received byte: {rbyte} ?= {wbyte}")
if rbyte == wbyte:
sync_f = True
print(f"INFO: Synchronization success!", end="")
else:
rbyte = ser.read(1)
if rbyte != wbyte:
Expand Down
12 changes: 10 additions & 2 deletions cmake/peakrdl/peakrdl_regblock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#]]
function(peakrdl_regblock IP_LIB)
# Parse keyword arguments
cmake_parse_arguments(ARG "" "OUTDIR;RENAME;INTF;RESET" "" ${ARGN})
cmake_parse_arguments(ARG "" "OUTDIR;RENAME;INTF;RESET" "PARAMETERS" ${ARGN})
# Check for any unknown argument
if(ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} passed unrecognized argument "
Expand Down Expand Up @@ -77,11 +77,19 @@ function(peakrdl_regblock IP_LIB)
set(RESET_ARG --default-reset ${ARG_RESET})
endif()

# Used to overwrite the top level parameters
set(OVERWRITTEN_PARAMETERS "")
if(ARG_PARAMETERS)
foreach(PARAM ${ARG_PARAMETERS})
set(OVERWRITTEN_PARAMETERS "${OVERWRITTEN_PARAMETERS}" "-P${PARAM}")
endforeach()
endif()

# Get the SystemRDL sources to generate the register block
# This function gets the IP sources and the deps
get_ip_sources(RDL_SOURCES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
Expand Down
13 changes: 11 additions & 2 deletions cmake/peakrdl/peakrdl_regblock_wrap.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function(peakrdl_regblock_wrap IP_LIB)
# Parse keyword arguments
cmake_parse_arguments(ARG "TMR" "OUTDIR;RENAME;INTF;RESET;OUT_LIST" "" ${ARGN})
cmake_parse_arguments(ARG "TMR" "OUTDIR;RENAME;INTF;RESET;OUT_LIST" "PARAMETERS" ${ARGN})
# Check for any unknown argument
if(ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} passed unrecognized argument "
Expand Down Expand Up @@ -58,11 +58,19 @@ function(peakrdl_regblock_wrap IP_LIB)
set(REGBLOCK_NAME ${ARG_RENAME})
endif()

# Used to overwrite the top level parameters
set(OVERWRITTEN_PARAMETERS "")
if(ARG_PARAMETERS)
foreach(PARAM ${ARG_PARAMETERS})
set(OVERWRITTEN_PARAMETERS "${OVERWRITTEN_PARAMETERS}" "-P${PARAM}")
endforeach()
endif()

# Get the SystemRDL sources to generate the register block
# This function gets the IP sources and the deps
get_ip_sources(RDL_SOURCES ${IP_LIB} SYSTEMRDL)

# Get SystemRDL include directories
# Get SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
Expand All @@ -83,6 +91,7 @@ function(peakrdl_regblock_wrap IP_LIB)
${RESET_ARG}
${TMR_OPT}
${INCDIR_ARG}
${OVERWRITTEN_PARAMETERS}
-o ${OUTDIR}
${RDL_SOURCES}
)
Expand Down
3 changes: 1 addition & 2 deletions cmake/peakrdl/peakrdl_socgen/peakrdl_socgen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function(peakrdl_socgen IP_LIB)
endif()

# Used to overwrite the top level parameters
set(OVERWRITTEN_PARAMETERS_TARGET "")
set(OVERWRITTEN_PARAMETERS "")
if(ARG_PARAMETERS)
foreach(PARAM ${ARG_PARAMETERS})
Expand All @@ -113,7 +112,7 @@ 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 SystemRDL include directories
get_ip_include_directories(INC_DIRS ${IP_LIB} SYSTEMRDL)
if(INC_DIRS)
set(INCDIR_ARG -I ${INC_DIRS})
Expand Down

0 comments on commit 6d5f934

Please sign in to comment.