@@ -439,7 +439,7 @@ def _generate_target_xml(
439439 clock_path ,
440440 lv_target_name ,
441441 lv_target_guid ,
442- num_hdl_registers ,
442+ max_hdl_reg_offset ,
443443):
444444 """Generate Target XML files from multiple Mako templates.
445445
@@ -455,7 +455,7 @@ def _generate_target_xml(
455455 clock_path (str): Path to the Clock XML (for filename extraction)
456456 lv_target_name (str): Name of the LabVIEW FPGA target
457457 lv_target_guid (str): GUID for the LabVIEW FPGA target
458- num_hdl_registers (int): Number of HDL registers
458+ max_hdl_reg_offset (int): Maximum HDL register offset (byte address)
459459
460460 Raises:
461461 SystemExit: If an error occurs during XML generation
@@ -465,9 +465,9 @@ def _generate_target_xml(
465465 boardio_filename = os .path .basename (boardio_path )
466466 clock_filename = os .path .basename (clock_path )
467467
468- # Calculate min_lv_reg_offset from num_hdl_registers
469- # Formula: num_hdl_registers * 4 , converted to hex with 5 hex digits (0x00000 format)
470- offset_value = num_hdl_registers * 4 if num_hdl_registers is not None else 0
468+ # Calculate min_lv_reg_offset from max_hdl_reg_offset
469+ # Formula: max_hdl_reg_offset + 4 (next 32-bit register) , converted to hex with 5 hex digits (0x00000 format)
470+ offset_value = max_hdl_reg_offset + 4 if max_hdl_reg_offset is not None else 0
471471 min_lv_reg_offset = f"0x{ offset_value :05X} "
472472
473473 # Ensure output directory exists
@@ -812,7 +812,7 @@ def gen_lv_target_support():
812812 config .clock_output ,
813813 config .lv_target_name ,
814814 config .lv_target_guid ,
815- config .num_hdl_registers ,
815+ config .max_hdl_reg_offset ,
816816 )
817817
818818 _copy_fpgafiles (
0 commit comments