8. Python API#
8.1. Introduction#
SpacePy is a scripting interface integrated into SpaceStudio and can be used to interact with SpaceStudio’s functionalities without the need to use the graphical user interface.
It allows scripting using Python 3.12.
8.1.1. Command-line interface#
Currently, SpaceStudio does not provide a REPL (Read-Eval-Print Loop) command-line interface, but only the ability to execute Python scripts in batch mode.
See Running a script in batch mode for more details.
8.1.2. Running a script in batch mode#
SpaceStudio can execute a Python script using the same executable as for starting the graphical interface :
SpaceStudio --batch <python_script> <arguments>
Note: The SpaceStudio executable used above is located in SpaceStudio’s installation directory.
From within the Python script itself, arguments are passed through the standard sys.argv list (the sys module must be imported first using import sys). The zero-th argument (i.e. sys.argv[0]) is the name of the Python script being executed, and the subsequent arguments are those passed after the script name in the command line.
In a script, the API entrypoint is the spacepy.Engine class, requiring the import of the spacepy module (using import spacepy). The spacepy.Engine class follows the singleton pattern, meaning it is used as follows :
import spacepy
engine = spacepy.Engine.instance()
You can then manipulate your SpaceStudio objects (projects, solutions, etc…) through the engine variable.
A full reference of the API is available in the API Documentation section.
8.2. Workflow Parameters#
spacepy.Workflow objects require attributes which depend on their type (e.g. simulation, architecture implementation, etc…).
The following sections describe these attributes.
8.2.1. Architecture Implementation#
Name |
Description |
Required ? |
|---|---|---|
|
Output directory |
Yes |
|
|
Yes |
|
|
|
|
Number of threads |
Yes |
|
|
No |
|
A collection of |
No |
|
TMR mode: { |
No |
|
Is safe FSM enable? |
No |
|
Safe FSM mode: { |
No |
8.2.2. FPGA-in-the-loop#
Name |
Description |
Required ? |
|---|---|---|
|
|
Yes |
|
|
Yes |
|
Number of threads |
Yes |
|
|
No |
|
A collection of |
No |
|
TMR mode: { |
No |
|
Is safe FSM enable? |
No |
|
Safe FSM mode: { |
No |
|
Host IP |
Yes |
|
Path for SSH private key |
Yes |
|
Wallclock timeout for remote execution |
No |
8.2.3. FPGA Estimation#
Name |
Description |
Required ? |
|---|---|---|
|
|
Yes |
|
|
Yes |
|
Number of threads |
Yes |
|
|
No |
|
A collection of |
No |
|
TMR mode: { |
No |
|
Is safe FSM enable? |
No |
|
Safe FSM mode: { |
No |
8.3. Examples#
This section presents some examples that showcase the Python API.
8.3.1. Display the content of a project#
In this example, the script displays all the instantiable components of SpaceStudio and displays the content of a project.
1import os
2import sys
3import spacepy as spy
4engine = spy.Engine.instance()
5
6def main(project_path: str) -> None:
7 for vlnv in engine.get_components():
8 print('component with vlnv = [{} {} {} {}]'.format(vlnv.get_vendor(), vlnv.get_library(), vlnv.get_name(), vlnv.get_version()))
9
10 project = engine.open(project_path)
11 project.clean()
12
13 print('project name = {}'.format(project.get_name()))
14 for solution in project.get_solutions():
15 print('\tsolution name = {}'.format(solution.get_name()))
16
17 for module in solution.get_modules():
18 print('\t\tmodule name = {}'.format(module.get_name()))
19 for device in solution.get_devices():
20 print('\t\tdevice name = {}'.format(device.get_name()))
21
22 for architecture in solution.get_architectures():
23 hls = None
24 hardware_modules = []
25
26 print('\t\tarchitecture name = {}'.format(architecture.get_name()))
27 for instance in architecture.get_module_instances():
28 print('\t\t\tmodule instance name = {}'.format(instance.get_name()))
29 print('\t\t\tmodule instance classname = {}'.format(instance.get_module().get_name()))
30 print('\t\t\tmodule instance is mapped in {}'.format('hardware' if instance.is_hardware() else 'software'))
31 show_parameters(instance)
32 if (instance.is_hardware()):
33 hardware_modules.append(instance)
34
35 recursively_show_parameters(architecture.get_component_instances())
36 project.close()
37
38def show_parameters(instance):
39 for param in instance.get_parameters():
40 if (param.is_read_only()):
41 print('\t\t\t{}={}\t(read only)'.format(param.get_name(), param.get_value()))
42 else:
43 print('\t\t\t{}={}'.format(param.get_name(), param.get_value()))
44
45def recursively_show_parameters(instances):
46 for instance in instances:
47 print('\t\t\tcomponent instance name = {}'.format(instance.get_name()))
48 print('\t\t\tcomponent instance vlnv = [{} {} {} {}]'.format(instance.get_vlnv().get_vendor(), instance.get_vlnv().get_library(), instance.get_vlnv().get_name(), instance.get_vlnv().get_version()))
49 show_parameters(instance)
50 if (instance.is_hierarchical()):
51 recursively_show_parameters(instance.get_component_instances())
52
53if __name__ == "__main__":
54 main(sys.argv[1])
Save the code snippet above as display.py. The location of this script is denoted below as %script_dir%. Open a terminal, navigate to SpaceStudio’s installation directory (denoted as %install_dir%), and run the following command :
SpaceStudio --batch %script_dir%/display.py %install_dir%/projects/producer-consumer/producer-consumer.spacestudio
The output should look similar to the following :
Space Codesign Systems Inc.
Copyright 2005-2026. All rights reserved
https://www.spacecodesign.com
SpaceStudio v5.0
Running script: display_components.py
Starting interpreter (may take some time)...
component with vlnv = [spacecodesign.com interconnect axi4_interconnect 1.0]
component with vlnv = [spacecodesign.com memory bram 1.0]
component with vlnv = [spacecodesign.com caip fft 1.0]
component with vlnv = [spacecodesign.com soc microblaze_soc 1.0]
component with vlnv = [spacecodesign.com soc ngultra 1.0]
component with vlnv = [spacecodesign.com ip register_file 1.0]
component with vlnv = [spacecodesign.com soc versal 1.0]
component with vlnv = [spacecodesign.com soc zynq 1.0]
component with vlnv = [spacecodesign.com soc zynq_ultrascale 1.0]
project name = producer-consumer
solution name = simple
module name = consumer
module name = producer
architecture name = all_hardware
module instance name = consumer0
module instance classname = consumer
module instance is mapped in hardware
documentation=
domain_id=0
id=4
id_key=CONSUMER0_ID
index=0
instance_name=
is_user_instantiable=true (read only)
8.3.2. Simulate all architectures of a project#
In this example, the script cleans the project (i.e. removes all generated files), and runs the simulation for all architectures.
1import os
2import sys
3import spacepy as spy
4
5engine = spy.Engine.instance()
6
7def main(project_path):
8 project = engine.open(project_path)
9 project.clean()
10 print("project name = {}".format(project.get_name()))
11
12 for solution in project.get_solutions():
13 print("solution name = {}".format(solution.get_name()))
14 for architecture in solution.get_architectures():
15 print('\tarchitecture name = {}'.format(architecture.get_name()))
16 workflow = architecture.get_workflow("simulation")
17 metrics = workflow.execute()
18 success = find_object_by_name(metrics, "Success")
19 print("[{}] {}".format(workflow.get_workflow_type(), "Success" if success.evaluate() else "Error"))
20
21 project.close()
22
23def find_object_by_name(collection, target_name):
24 for obj in collection:
25 if obj.get_name() == target_name:
26 return obj
27 return None
28
29if __name__ == "__main__":
30 main(sys.argv[1])
Save the code snippet above as simulate.py. The location of this script is denoted below as %script_dir%. Open a terminal, navigate to SpaceStudio’s installation directory (denoted as %install_dir%), and run the following command :
SpaceStudio --batch %script_dir%/simulate.py %install_dir%/projects/producer-consumer/producer-consumer.spacestudio
The output should look similar to the following :
Space Codesign Systems Inc.
Copyright 2005-2026. All rights reserved
https://www.spacecodesign.com
SpaceStudio v5.0
Running script: simulate_all.py
Starting interpreter (may take some time)...
solution name = simple
architecture name = all_hardware
[Launching process] C:/SpaceCodesign/SpaceStudio-5.0/util/ninja/ninja.exe -f all.ninja
[1/7] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/hw/components.cpp
[2/7] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/hw/architecture.cpp
[3/7] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/hw/bus_addresses.cpp
[4/7] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/module/consumer0/consumer0.cpp
[5/7] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/module/producer0/producer0.cpp
[6/7] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/hw/main.cpp
[7/7] Creating C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/bin/all_hardware.exe
[Process completed] C:/SpaceCodesign/SpaceStudio-5.0/ninja.exe -f all.ninja
[Launching process] C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/solutions/simple/architectures/all_hardware/build/sim/bin/all_hardware.exe
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Space Codesign Systems Inc.
Copyright 2005-2026. All rights reserved
https://www.spacecodesign.com
SpaceStudio 5.0
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Starting simulation.
consumer0 running
producer0 running
consumer0 register value=240
consumer0 ddr value=240
consumer0 register value=241
consumer0 ddr value=241
consumer0 register value=242
consumer0 ddr value=242
consumer0 register value=243
consumer0 ddr value=243
consumer0 register value=244
consumer0 ddr value=244
consumer0 register value=245
consumer0 ddr value=245
consumer0 register value=246
consumer0 ddr value=246
consumer0 register value=247
consumer0 ddr value=247
consumer0 register value=248
consumer0 ddr value=248
consumer0 register value=249
consumer0 ddr value=249
consumer0 register value=250
consumer0 ddr value=250
8.3.3. Architecture Implementation export#
In this example, the script executes the architecture implementation workflow :
Enables preferences
Creates an architecture
Instantiates component instances
Maps modules to hardware and software
Runs architecture implementation using Vivado
1import os
2import sys
3import spacepy as spy
4
5engine = spy.Engine.instance()
6
7def main(project_path: str) -> None:
8 project = engine.open(project_path)
9
10 # Get instantiable components
11 zynq_vlnv = engine.get_component("zynq")
12 interconnect_vlnv = engine.get_component("axi4_interconnect")
13 bram_vlnv = engine.get_component("bram")
14 register_file_vlnv = engine.get_component("register_file")
15
16 # Get exisiting solution and create the example architecture
17 solution = project.get_solution("simple")
18 solution.remove_architecture("example_architecture")
19 architecture = solution.create_architecture("example_architecture")
20
21 # Instantiate modules
22 consumer0 = architecture.create_module_instance("consumer")
23 producer0 = architecture.create_module_instance("producer")
24
25 # Instantiate components
26 zynq0 = architecture.create_component_instance(zynq_vlnv)
27 interconn0 = architecture.create_component_instance(interconnect_vlnv)
28 bram0 = architecture.create_component_instance(bram_vlnv)
29 bram0.set_name("ddr_mem")
30 architecture.create_component_instance(register_file_vlnv)
31
32 # Connect bram with interconnect
33 interconn0.get_bus_interface("axi_master_0").connect(bram0.get_bus_interface("axi_slave"))
34
35 # Map module instances in SW or HW
36 producer0.move_to_hardware()
37 consumer0.move_to_software(zynq0)
38
39 # Enable EDA
40 engine.get_eda_preference("eda.vivado_2025-2.is_enabled").set_value("true")
41 engine.get_eda_preference("eda.vitis_hls_2025-2.is_enabled").set_value("true")
42
43 # Get architecture implementation workflow
44 workflow = architecture.get_workflow("implementation")
45
46 # Configure workflow
47 implementation = architecture.get_implementation("vivado_2025-2")
48 hls = implementation.get_synthesizer("vitis_hls_2025-2")
49 board = implementation.get_board("zed")
50 project_dir = os.path.join(os.path.dirname(project_path), "impl")
51 workflow.get_parameter("impl.general.directory").set_value(project_dir)
52 workflow.get_parameter("impl.general.eda").set_value(implementation)
53 workflow.get_parameter("impl.general.board").set_value(board)
54 workflow.get_parameter("impl.general.thread").set_value(4)
55 workflow.get_parameter("impl.hls.name").set_value(hls)
56 workflow.get_parameter("impl.hls.modules").set_value(producer0)
57
58 # Execute workflow
59 metrics = workflow.execute()
60 success = find_object_by_name(metrics, "Success")
61 print("[{}] {}".format(workflow.get_workflow_type(), "Success" if success.evaluate() else "Error"))
62
63 # Exit
64 project.save()
65 project.close()
66
67def find_object_by_name(collection, target_name):
68 for obj in collection:
69 if obj.get_name() == target_name:
70 return obj
71 return None
72
73if __name__ == "__main__":
74 main(sys.argv[1])
Save the code snippet above as complete_flow.py. The location of this script is denoted below as %script_dir%. Open a terminal, navigate to SpaceStudio’s installation directory (denoted as %install_dir%), and run the following command :
SpaceStudio --batch %script_dir%/complete_flow.py %install_dir%/projects/producer-consumer/producer-consumer.spacestudio
The output should look similar to the following :
Space Codesign Systems Inc.
Copyright 2005-2026. All rights reserved
https://www.spacecodesign.com
SpaceStudio v5.0
Running script: impl_export.py
Starting interpreter (may take some time)...
Generation process [Starting]
Generation process [Completed successfully]
Architecture's transformation [Starting]
Architecture's transformation [Completed successfully]
Software build [Starting]
[Launching process] C:/SpaceCodesign/SpaceStudio-5.0/util/ninja/ninja.exe -f all.ninja
[1/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/data/sw/OS/linux/internal_api.c
[2/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/interrupts.cpp
[3/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/communication.cpp
[4/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/main.cpp
[5/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/fifo_monitor_hooks.cpp
[6/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/module/consumer0/consumer0.cpp
[7/8] Compiling C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/application_os_requirement.cpp
[8/8] Creating C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/processors/zynq_apu0/zynq_apu0.core0.arm_a9.elf
[Process completed] C:/SpaceCodesign/SpaceStudio-5.0/util/ninja/ninja.exe -f all.ninja
Software build [Completed successfully]
High-level synthesis [Starting]
Synthesizing 'producer0' with Xilinx - Vitis HLS 2025.2 (log: C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/hls/producer0/producer0_synth.log)
Exporting 'producer0' (log: C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/hls/producer0/producer0_export.log)
Synthesis of producer0 completed
High-level synthesis [Completed successfully]
EDA Project Generation [Starting]
****** Vivado v2025.2 (64-bit)
**** SW Build 6299465 on Fri Nov 14 19:35:11 GMT 2025
**** IP Build 6300035 on Fri Nov 14 10:48:45 MST 2025
**** SharedData Build 6298862 on Thu Nov 13 04:50:51 MST 2025
**** Start of session at: Mon Mar 23 15:52:36 2026
** Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
** Copyright 2022-2025 Advanced Micro Devices, Inc. All Rights Reserved.
source create_project.tcl
# variable SCRIPT_DIR [file dirname [file normalize [info script]]]
# variable PROJECT_DIR ${SCRIPT_DIR}
# set PROJECT_NAME "example_architecture"
# set BLOCK_DESIGN_NAME "bd"
# set PART_NAME "xc7z020clg484-1"
# set BOARD_VENDOR "em.avnet.com"
# set BOARD_LIBRARY "board"
# set BOARD_NAME "zed"
# set BOARD_VERSION "1.4"
# set REPOSITORY_PATH "C:/SpaceCodesign/SpaceStudio-5.0/projects/producer-consumer/impl/application_repository"
# set NUM_THREADS "4"
# proc set_board_parts {} {
# # Vivado doesn't come with the XML for certain third-party boards
# # (e.g. zedboard), so we have to provide them to it.
# global BOARD_REPO_PATH
# set_param board.repoPaths "${BOARD_REPO_PATH}"
# }
# set_board_parts
# create_project ${PROJECT_NAME} -force -part "${PART_NAME}"
# set_property board_part ${BOARD_VENDOR}:${BOARD_NAME}:part0:${BOARD_VERSION} [current_project]
# set_property STEPS.SYNTH_DESIGN.ARGS.FLATTEN_HIERARCHY none [get_runs synth_1]
# create_bd_design bd
create_bd_design: Time (s): cpu = 00:00:02 ; elapsed = 00:00:06 . Memory (MB): peak = 623.594 ; gain = 27.184
# proc spacestudio_set_severities {} {
# # Detect and stop if a Vivado synthesis ever detects that we've badly
# # connected a reset (e.g. we've connected a reset associated with clockA
# # to the reset pin of an interface that is associated with clockB). This
# # would easily be a cause for timing errors.
# set_msg_config -id "BD 41-1344" -new_severity "ERROR"
# # Downgrade warning that we're assigning to a vector of size 0; there's
# # nothing wrong with that.
# set_msg_config -id "Synth 8-3919" -new_severity "INFO"
# # Similar; downgrade warning that an entity's port is a vector of size 0.
# set_msg_config -id "Synth 8-506" -new_severity "INFO"
# # Similar; downgrade warning that a signal is a vector of size 0.
# set_msg_config -id "Synth 8-6774" -new_severity "INFO"
# # Downgrade warning that an instantiation's port mapping is assigned to
# # "open".
# set_msg_config -id "Synth 8-6778" -new_severity "INFO"
8.4. API Documentation#
The entry point for the API is the spacepy.Engine class.
- class spacepy.Architecture#
Bases:
objectAn
Architecturerepresents a virtual platform. It is composed of instances (i.e.ComponentInstance,ModuleInstance, andDeviceInstance) which are mapped onto the system architecture.- clean() None#
Cleans the architecture.
Usually, this involves the removal of generated files, such as generated source files and compiled binaries.
- Return type:
None
- compile(build_type: str | None = None) spacepy.Metric#
Compiles the architecture.
- Parameters:
build_type (str | None) – The (optional) type of build to perform, one of
"release"or"monitoring". If unspecified orNone, the default build will be used.- Returns:
A
Metricobject that contains the result of the compilation.- Return type:
- create_component_instance(vlnv: spacepy.VLNV) spacepy.ComponentInstance#
Creates a new component instance in the architecture based on the provided VLNV.
- Parameters:
vlnv (spacepy.VLNV) – The VLNV of the component to create an instance of.
- Returns:
The newly created component instance.
- Return type:
- create_device_instance(device_name: str) spacepy.DeviceInstance#
Creates a new device instance of the given device in the architecture. The device name must correspond to an existing device in the project, otherwise an exception is raised.
- Parameters:
device_name (str) – The name of the device to create an instance of.
- Returns:
The newly created device instance.
- Return type:
- create_module_instance(module_name: str) spacepy.ModuleInstance#
Creates a new module instance of the given module in the architecture. The module name must correspond to an existing module in the project, otherwise an exception is raised.
- Parameters:
module_name (str) – The name of the module to create an instance of.
- Returns:
The newly created module instance.
- Return type:
- get_communications() Iterable[spacepy.Communication]#
Returns the result of the communications analysis, i.e. a collection of the communications in the architecture.
- Returns:
A collection of the communications in the architecture.
- Return type:
Iterable[spacepy.Communication]
- get_component_instance(instance_name: str) spacepy.ComponentInstance#
Returns the component instance with the specified name in the architecture. If no component instance with the specified name exists, an exception is raised.
- Parameters:
instance_name (str) – The name of the component instance to return.
- Returns:
The component instance with the specified name.
- Return type:
- get_component_instances() Iterable[spacepy.ComponentInstance]#
Returns a collection of the component instances in the architecture. Note : the returned collection does not include device and module instances, use
get_device_instances()andget_module_instances()for those.- Return type:
Iterable[spacepy.ComponentInstance]
- get_device_instance(instance_name: str) spacepy.DeviceInstance#
Returns the device instance with the specified name in the architecture. If no device instance with the specified name exists, an exception is raised.
- Parameters:
instance_name (str) – The name of the device instance to return.
- Returns:
The device instance with the specified name.
- Return type:
- get_device_instances() Iterable[spacepy.DeviceInstance]#
Returns a collection of the device instances in the architecture.
- Returns:
A collection of the device instances in the architecture.
- Return type:
Iterable[spacepy.DeviceInstance]
- get_implementation(tool_name: str) spacepy.Implementation#
Returns the implementation tool with the specified name in the architecture. If no implementation tool with the specified name exists, an exception is raised.
- Parameters:
tool_name (str) – The name of the implementation tool.
- Returns:
The implementation tool with the specified name.
- Return type:
- get_implementations() Iterable[spacepy.Implementation]#
Returns a collection of the implementation tools available in the architecture.
- Returns:
A collection of the implementation tools available in the architecture.
- Return type:
Iterable[spacepy.Implementation]
- get_module_instance(instance_name: str) spacepy.ModuleInstance#
Returns the module instance with the specified name in the architecture. If no module instance with the specified name exists, an exception is raised.
- Parameters:
instance_name (str) – The name of the module instance to return.
- Returns:
The module instance with the specified name.
- Return type:
- get_module_instances() Iterable[spacepy.ModuleInstance]#
Returns a collection of the module instances in the architecture.
- Returns:
A collection of the module instances in the architecture.
- Return type:
Iterable[spacepy.ModuleInstance]
- get_name() str#
Returns the name of the architecture.
- Returns:
The name of the architecture.
- Return type:
str
- get_preferences() Iterable[spacepy.Preference]#
Returns a collection of the preferences for the architecture.
- Returns:
A collection of the preferences for the architecture.
- Return type:
Iterable[spacepy.Preference]
- get_workflow(workflow: str, build: str | None = None) spacepy.Workflow#
Returns the workflow corresponding to the given workflow and build type.
- Parameters:
workflow (str) – The type of workflow to return. One of {“simulation”, “implementation”, “estimation”, “fpga-in-the-loop”}.
build (str | None) – The type of build to return. One of {“release”, “monitoring”}.
- Returns:
The workflow corresponding to the given workflow and build type.
- Return type:
- remove_component_instance(instance_name: str) None#
Removes a component instance with the specified name from the architecture. If no component instance with the specified name exists, does nothing.
- Parameters:
instance_name (str) – The name of the component instance to remove.
- Return type:
None
- save() None#
Saves the architecture.
- Return type:
None
- class spacepy.Board#
Bases:
objectA
Boardcontains information about a specific board’s resources.The quantity of resources needed to implement a specific architecture depends on the targeted FPGA. A
Boardgives access toMetricobjects which can evaluate a specific resource’s usage and the quantity of resources available on the FPGA.- get_available_resources() Iterable[spacepy.Metric]#
Returns a collection of
Metricobjects representing the available resources on the board’s FPGA.- Returns:
A collection of
Metricobjects representing the available resources on the board’s FPGA.- Return type:
Iterable[spacepy.Metric]
- get_name() str#
Returns the name of the board.
- Returns:
The name of the board.
- Return type:
str
- class spacepy.BusInterface#
Bases:
objectA
BusInterfaceis an interface that belongs to a component instance and can be connected to other bus interfaces.- belongs_to() spacepy.ComponentInstance#
Returns the component instance to which the bus interface belongs.
- Returns:
The component instance to which the bus interface belongs.
- Return type:
- connect(bus_interface: spacepy.BusInterface) None#
Connects the bus interface to another bus interface.
- Parameters:
bus_interface (spacepy.BusInterface) – The bus interface to connect to.
- Return type:
None
- disconnect() None#
Disconnects the bus interface from any bus interface it is currently connected to, if any.
If the bus interface is not currently connected to any other bus interface, does nothing.
- Return type:
None
- get_bus_definition() spacepy.VLNV#
Returns the VLNV of the bus definition associated with the bus interface.
- Returns:
The VLNV of the bus definition associated with the bus interface.
- Return type:
- get_connected_bus_interface() Iterable[spacepy.BusInterface]#
Returns the bus interface(s) currently connected to the bus interface.
- Returns:
The bus interface(s) currently connected to the bus interface. If the bus interface is not currently connected to any other bus interface, returns an empty collection.
- Return type:
Iterable[spacepy.BusInterface]
- get_mode() str#
Returns the mode of the bus interface.
- Returns:
The mode of the bus interface, one of {“master”, “slave”, “mmaster”, “mslave”}.
- Return type:
str
- get_name() str#
Returns the name of the bus interface.
- Returns:
The name of the bus interface.
- Return type:
str
- is_connected() bool#
Returns whether the bus interface is currently connected to another bus interface.
- Returns:
True if the bus interface is currently connected to another bus interface, False otherwise.
- Return type:
bool
- class spacepy.Communication#
Bases:
objectA
Communicationrepresents a communication of a certain type between two module instances. One module instance is the reader of the communication, and the other is the writer.- get_channel_width() int#
Returns the channel width of the communication, in bits.
- Returns:
The channel width of the communication, in bits.
- Return type:
int
- get_possible_types() Iterable[str]#
Returns the possible types this communication can support, based on the reader and writer module instances’ mapping.
- Returns:
The possible types for the communication.
- Return type:
Iterable[str]
- get_reader() spacepy.ModuleInstance#
Returns the reader module instance of the communication.
- Returns:
The reader module instance of the communication.
- Return type:
- get_type() spacepy.CommunicationType#
Returns the type of the communication.
- Returns:
The type of the communication. One of {
"fifo_hw","fifo_sw","dma"}.- Return type:
- get_writer() spacepy.ModuleInstance#
Returns the writer module instance of the communication.
- Returns:
The writer module instance of the communication.
- Return type:
- set_type(new_type: spacepy.CommunicationType) None#
Sets the type of the communication.
- Parameters:
new_type (spacepy.CommunicationType) – The new type of the communication. One of {
"fifo_hw","fifo_sw","dma"}.- Return type:
None
- class spacepy.CommunicationType#
Bases:
objectA
CommunicationTyperepresents the type of a communication, (either hardware FIFO, software FIFO, or DMA). It also gives access to the specific parameters of each type of communication.- get_depth() int#
Returns the depth of the communication.
Only applicable if the communication type is
"fifo_hw"or"fifo_sw". Otherwise, behavior is undefined.- Return type:
int
- get_latency() int#
Returns the latency of the communication, in clock cycles.
Only applicable if the communication type is
"fifo_hw". Otherwise, behavior is undefined.- Return type:
int
- get_name() str#
Returns the name of the communication type.
- Returns:
The name of the communication type, one of {
"fifo_hw","fifo_sw","dma"}.- Return type:
str
- set_depth(depth: int) None#
Sets the depth of the communication.
Only applicable if the communication type is
"fifo_hw"or"fifo_sw". Otherwise, behavior is undefined.- Parameters:
depth (int) – The new depth of the communication, in number of data elements.
- Return type:
None
- set_latency(latency: int) None#
Sets the latency of the communication.
Only applicable if the communication type is
"fifo_hw". Otherwise, behavior is undefined.- Parameters:
latency (int) – The new latency of the communication, in clock cycles.
- Return type:
None
- class spacepy.ComponentInstance#
Bases:
objectA
ComponentInstanceis an instance of an IP (Intellectual Property) core such as processors, user devices, memories, UARTs, etc…These core can be instantiated in any architecture.
- get_bus_interface(bus_interface_name: str) spacepy.BusInterface#
Returns the bus interface with the specified name belonging to the component instance.
If no bus interface with the specified name exists, an exception is raised.
- Parameters:
bus_interface_name (str) – The name of the bus interface to return.
- Returns:
The bus interface with the specified name belonging to the component instance.
- Return type:
- get_bus_interfaces() Iterable[spacepy.BusInterface]#
Returns a collection of the bus interfaces belonging to the component instance.
- Returns:
A collection of the bus interfaces belonging to the component instance.
- Return type:
Iterable[spacepy.BusInterface]
- get_component_instance(name: str) spacepy.ComponentInstance#
Returns the component instance with the specified name contained in the component instance.
This exists for hierarchical components only, such as a SoC component which contains a processor and some peripherals.
If no component instance with the specified name exists, an exception is raised.
- Parameters:
name (str) – The name of the component instance to return.
- Returns:
The component instance with the specified name contained in the component instance.
- Return type:
- get_component_instances() Iterable[spacepy.ComponentInstance]#
Returns a collection of the component instances contained in the component instance.
This exists for hierarchical components only, such as a SoC component which contains a processor and some peripherals.
- Returns:
A collection of the component instances contained in the component instance.
- Return type:
Iterable[spacepy.ComponentInstance]
- get_cores() Iterable[spacepy.Core]#
Returns a collection of the cores contained in the component instance.
This exists for processors instances only. Processor instances can be identified by having the string
"processor"as their VLNV library name.- Returns:
A collection of the cores contained in the component instance.
- Return type:
Iterable[spacepy.Core]
- get_name() str#
Returns the name of the component instance.
- Returns:
The name of the component instance.
- Return type:
str
- get_parameter(parameter_name: str) spacepy.Parameter#
Returns the parameter with the specified name belonging to the component instance.
If no parameter with the specified name exists, an exception is raised.
- Parameters:
parameter_name (str) – The name of the parameter to return.
- Returns:
The parameter with the specified name belonging to the component instance.
- Return type:
- get_parameters() Iterable[spacepy.Parameter]#
Returns a collection of the parameters belonging to the component instance.
- Returns:
A collection of the parameters belonging to the component instance.
- Return type:
Iterable[spacepy.Parameter]
- get_vlnv() spacepy.VLNV#
Returns the VLNV of the component instance.
- Returns:
The VLNV of the component instance.
- Return type:
- is_hierarchical() bool#
Returns whether the component instance is hierarchical, i.e. contains other component instances.
This is the case for SoC components, which may reveal multiple processor instances and other peripherals as component instances contained in the SoC component instance.
- Returns:
True if the component instance is hierarchical, False otherwise.
- Return type:
bool
- set_name(name: str) None#
Sets the name of the component instance.
- Parameters:
name (str) – The new name of the component instance.
- Return type:
None
- class spacepy.Core#
Bases:
objectRepresents a physical core of a processor. A
ModuleInstancecan be mapped to a core to be executed as a software therad.- get_operating_system() str#
Returns the operating system running on the core.
- Returns:
The operating system running on the core, as a string.
- Return type:
str
- get_supported_operating_systems() Iterable[str]#
Returns the operating systems supported by the core.
- Returns:
The operating systems supported by the core, as a collection of strings. Each string is one of {
"microc","baremetal","rtems","linux","freertos"}.- Return type:
Iterable[str]
- set_operating_system(os: str) None#
Sets the operating system running on the core.
- Parameters:
os (str) – The new operating system to run on the core, as a string. One of {
"microc","baremetal","rtems","linux","freertos"}.- Return type:
None
- class spacepy.Device#
Bases:
objectRepresents a SpaceStudio device “spec” (i.e., not an instance, but a device as defined in the project, from which instances can be created).
- add_import(path: str) None#
Adds an import to the device.
- Parameters:
path (str) – The absolute path to the file or folder to import.
- Return type:
None
- add_parameter(name: str, value: str) None#
Defines a new user parameter for the device with the given name and value.
If the given parameter name already exists for the device, an exception is raised. To update a parameter’s value, use the
Parameter.set_value()method of the object returned byget_parameter().- Parameters:
name (str) – The name of the user parameter to add.
value (str) – The value of the user parameter to add.
- Return type:
None
- get_compiler_build_option(option_name: str) spacepy.ToolchainBuildOption#
Returns the compiler build option with the specified name related to the device.
If no compiler build option with the specified name exists, an exception is raised.
- Parameters:
option_name (str) – The name of the compiler build option to return.
- Returns:
The compiler build option with the specified name related to the device.
- Return type:
- get_compiler_build_options() Iterable[spacepy.ToolchainBuildOption]#
Returns the collection of all build options for the compiler related to the device.
- Returns:
A collection of all build options for the compiler related to the device.
- Return type:
Iterable[spacepy.ToolchainBuildOption]
- get_header_path() str#
Returns the absolute path to the device’s header (.h) file.
- Returns:
The absolute path to the device’s header file.
- Return type:
str
- get_imports() Iterable[str]#
Returns a collection of the device’s imported files and folders.
- Returns:
A collection of the device’s imported files and folders.
- Return type:
Iterable[str]
- get_name() str#
Returns the name of the device.
- Returns:
The name of the device.
- Return type:
str
- get_parameter(parameter_name: str) spacepy.Parameter#
Returns the user parameter with the specified name belonging to the device.
If no user parameter with the specified name exists, an exception is raised.
- Parameters:
parameter_name (str) – The name of the user parameter to return.
- Returns:
The user parameter with the specified name belonging to the device.
- Return type:
- get_parameters() Iterable[spacepy.Parameter]#
Returns a collection of all the user parameters defined for the device.
- Returns:
A collection of all the user parameters defined for the device.
- Return type:
Iterable[spacepy.Parameter]
- get_source_path() str#
Returns the absolute path to the device’s source (.cpp) file.
- Returns:
The absolute path to the device’s source file.
- Return type:
str
- remove_import(path: str) None#
Removes an import from the device.
- Parameters:
path (str) – The absolute path to the file or folder to remove.
- Return type:
None
- remove_parameter(name: str) None#
Removes the user parameter with the given name from the device.
If no user parameter with the given name exists for the device, fails with an exception.
- Parameters:
name (str) – The name of the user parameter to remove.
- Return type:
None
- class spacepy.DeviceInstance#
Bases:
spacepy.ComponentInstanceProvides access to an instance of a
Device.A
DeviceInstanceis aComponentInstance. Therefore, all methods defined forComponentInstanceare also available forDeviceInstance.- get_device() spacepy.Device#
Returns the
Devicecorresponding to theDeviceInstance.- Returns:
The
Devicecorresponding to theDeviceInstance.- Return type:
- class spacepy.Engine#
Bases:
objectThe
Engineis the entry point to the SpacePy API. It follows the singleton pattern, and can thus be accessed as follows :from spacepy import Engine engine = Engine.instance()
- create(project_name: str, project_path: str) spacepy.Project#
Creates a new SpaceStudio project with the given name and path, and returns the created
Projectobject.- Parameters:
project_name (str) – The name of the project to create.
project_path (str) – The absolute path to the folder in which to create the project.
- Returns:
The created
Projectobject.- Return type:
- get_component(name: str) spacepy.VLNV#
Retrieves the platform IP with the given name (i.e. name field of the VLNV). If no platform IP with the given name exists, an exception is raised.
- Parameters:
name (str) – The name of the platform IP to retrieve.
- Returns:
The VLNV corresponding to the platform IP with the given name.
- Return type:
- get_components() Iterable[spacepy.VLNV]#
Returns all the platform IPs that can be instantiated in an architecture.
- Returns:
A collection of VLNVs corresponding to all the platform IPs that can be instantiated in an architecture.
- Return type:
Iterable[spacepy.VLNV]
- get_eda_preference(name: str) spacepy.Preference#
Returns the EDA preference with the given name.
If no EDA preference with the given name exists, an exception is raised.
- Parameters:
name (str) – The name of the EDA preference to return.
- Returns:
The EDA preference with the given name.
- Return type:
- get_eda_preferences() Iterable[spacepy.Preference]#
Returns all EDA preferences.
- Returns:
A collection of all EDA preferences.
- Return type:
Iterable[spacepy.Preference]
- get_sys() Any#
Retrieves system information
- Returns:
System information.
- Return type:
Any
- get_toolchain_preference(name: str) spacepy.Preference#
Returns the toolchain preference with the given name.
If no toolchain preference with the given name exists, an exception is raised.
- Parameters:
name (str) – The name of the toolchain preference to return.
- Returns:
The toolchain preference with the given name.
- Return type:
- get_toolchain_preferences() Iterable[spacepy.Preference]#
Returns all the preferences of the engine regarding the toolchains
- Returns:
A collection of all the preferences of the engine regarding the toolchains.
- Return type:
Iterable[spacepy.Preference]
- get_version() spacepy.Version#
This method retrieves a
Versioninstance representing the version of SpaceStudio currently running.The
Version.get_major(),Version.get_minor(), andVersion.get_patch()methods of the returnedVersioninstance are always guaranteed to return strings that can be cast as an integer between 0 and 999,999, as base-10 integers.Therefore, version-checking can be performed as follows:
def make_version_number(major_int, minor_int = 0, patch_int = 0): return major_int * 1000000000000 + minor_int * 1000000 + patch_int major_int = int(version.get_major()) minor_int = int(version.get_minor()) patch_int = int(version.get_patch()) ss_ver_num = make_version_number(major_int, minor_int, patch_int) if ss_ver_num >= make_version_number(4, 4): # SpaceStudio >= 4.4.0 else: # SpaceStudio < 4.4.0
Note: this function was introduced in SpaceStudio 4.3, Python code that needs to remain compatible with versions prior to 4.3 can do something along the lines of the following :
try: version = space_engine.get_version() # SpaceStudio >= 4.3 ss_with_version = True except AttributeError: # SpaceStudio < 4.3 ss_with_version = False
- Returns:
A
Versioninstance representing the version of SpaceStudio currently running.- Return type:
- static instance() spacepy.Engine#
Returns the singleton instance of the
Engine.- Returns:
The singleton instance of the
Engine.- Return type:
- open(project_file: str) spacepy.Project#
Opens the SpaceStudio project at the given file path, and returns the corresponding
Projectobject.If any error occurs while opening the project (e.g., if the file does not exist, or if the file is not a valid
.spacestudioproject file), an exception is raised.- Parameters:
project_file (str) – The absolute path to the
.spacestudiofile of the project to open.- Returns:
The Project object corresponding to the opened project.
- Return type:
- class spacepy.HLSSynthesizer#
Bases:
objectProvides control over a High-Level Synthesis (HLS) tool used for hardware synthesis.
- get_name() str#
Returns the name of the HLS synthesizer.
- Returns:
The name of the HLS synthesizer.
- Return type:
str
- class spacepy.Implementation#
Bases:
objectProvides control over an implementation tool used for hardware implementation (place and route, bitstream generation, etc…) for FPGA estimation and architecture implementation.
- clean() None#
Cleans the implementation cache for the implementation tool.
- Return type:
None
- get_board(name: str) spacepy.Board#
Retrieves the board with the given name among the boards supported by the implementation tool.
If no board with the given name exists among the boards supported by the implementation tool, an exception is raised.
- Parameters:
name (str) – The name of the board to retrieve.
- Returns:
The
Boardobject representing the board with the given name.- Return type:
- get_boards() Iterable[spacepy.Board]#
Returns a collection of
Boardobjects representing the boards supported by the implementation tool.- Returns:
A collection of
Boardobjects representing the boards supported by the implementation tool.- Return type:
Iterable[spacepy.Board]
- get_name() str#
Returns the name of the implementation tool.
- Returns:
The name of the implementation tool.
- Return type:
str
- get_synthesizer(name: str) spacepy.HLSSynthesizer#
Retrieves the HLS synthesizer with the given name among the HLS synthesizers supported by the implementation tool.
If no HLS synthesizer with the given name exists among the HLS synthesizers supported by the implementation tool, an exception is raised.
- Parameters:
name (str) – The name of the HLS synthesizer to retrieve.
- Returns:
The
HLSSynthesizerobject representing the HLS synthesizer with the given name.- Return type:
- get_synthesizers() Iterable[spacepy.HLSSynthesizer]#
Returns a collection of
HLSSynthesizerobjects representing the HLS synthesizers supported by the implementation tool.- Returns:
A collection of
HLSSynthesizerobjects representing the HLS synthesizers supported by the implementation tool.- Return type:
Iterable[spacepy.HLSSynthesizer]
- class spacepy.Metric#
Bases:
objectA
Metricis a named quantity measuring a specific property (i.e. simulation time, board resource usage, power consumption, etc…).- get_name() str#
Returns the name of the metric.
- Returns:
The name of the metric.
- Return type:
str
- get_value() float#
This method evaluates the representation of the metric
- Returns:
The value of the metric, as a float (actually a
doublein Java backend code).- Return type:
float
- class spacepy.Module#
Bases:
objectProvides access to a SpaceStudio module “spec” (i.e., not an instance, but a module as defined in the project, from which instances can be created).
- add_import(path: str) None#
Adds an import to the module.
- Parameters:
path (str) – The absolute path to the file or folder to import.
- Return type:
None
- add_parameter(name: str, value: str) None#
Defines a new user parameter for the module with the given name and value.
If the given parameter name already exists for the module, an exception is raised. To update a parameter’s value, use the
Parameter.set_value()method of the object returned byget_parameter().- Parameters:
name (str) – The name of the user parameter to add.
value (str) – The value of the user parameter to add.
- Return type:
None
- get_compiler_build_option(option_name: str) spacepy.ToolchainBuildOption#
Returns the compiler build option with the given name.
If no compiler build option with the given name exists for the module, an exception is raised. :param option_name: The name of the compiler build option to return. :return: The compiler build option with the given name.
- Parameters:
option_name (str) –
- Return type:
- get_compiler_build_options() Iterable[spacepy.ToolchainBuildOption]#
Returns a collection of the compiler build options for the module.
- Returns:
A collection of the compiler build options for the module.
- Return type:
Iterable[spacepy.ToolchainBuildOption]
- get_header_path() str#
Returns the absolute path to the module’s header (.h) file.
- Returns:
The absolute path to the module’s header file.
- Return type:
str
- get_imports() Iterable[str]#
Returns a collection of the module’s imported files and folders.
- Returns:
A collection of the module’s imported files and folders.
- Return type:
Iterable[str]
- get_name() str#
Returns the name of the module.
- Returns:
The name of the module.
- Return type:
str
- get_parameter(parameter_name: str) spacepy.Parameter#
Returns the user parameter with the specified name belonging to the module.
If no user parameter with the specified name exists, an exception is raised. :param parameter_name: The name of the user parameter to return. :return: The user parameter with the specified name belonging to the module.
- Parameters:
parameter_name (str) –
- Return type:
- get_parameters() Iterable[spacepy.Parameter]#
Returns a collection of all the user parameters defined for the module.
- Returns:
A collection of all the user parameters defined for the module.
- Return type:
Iterable[spacepy.Parameter]
- get_source_path() str#
Returns the absolute path to the module’s source (.cpp) file.
- Returns:
The absolute path to the module’s source file.
- Return type:
str
- remove_import(path: str) None#
Removes an import from the module.
- Parameters:
path (str) – The absolute path to the file or folder to remove.
- Return type:
None
- remove_parameter(name: str) None#
Removes the user parameter with the given name from the module.
If no user parameter with the given name exists for the module, fails with an exception.
- Parameters:
name (str) – The name of the user parameter to remove.
- Return type:
None
- class spacepy.ModuleInstance#
Bases:
spacepy.ComponentInstanceProvides access to an instance of a
Module.A
ModuleInstancecan be instantiated as a hardware accelerator or as a software thread running on a processor.A
ModuleInstanceis aComponentInstance. Therefore, all methods defined forComponentInstanceare also available forModuleInstance.- get_module() spacepy.Module#
Returns the
Modulecorresponding to theModuleInstance.- Returns:
The
Modulecorresponding to theModuleInstance.- Return type:
- is_hardware() bool#
Retrieves whether the
ModuleInstanceis currently mapped to hardware. :return:Trueif theModuleInstanceis mapped to hardware,Falseotherwise.- Return type:
bool
- is_software() bool#
Retrieves whether the
ModuleInstanceis currently mapped to software.- Returns:
Trueif theModuleInstanceis mapped to software,Falseotherwise.- Return type:
bool
- move_to_hardware() None#
Maps the
ModuleInstanceto hardware to be executed as a hardware accelerator.- Return type:
None
- move_to_software(core: spacepy.Core) None#
Maps the
ModuleInstanceto the given core to be executed as a software thread.- Parameters:
core (spacepy.Core) – The core to which the
ModuleInstancewill be mapped.- Return type:
None
- class spacepy.Parameter#
Bases:
objectA
Parameteris a user-defined name-value that can be used in aModuleorDevice.- get_name() str#
Returns the name of the parameter.
- Returns:
The name of the parameter.
- Return type:
str
- get_value() str#
Returns the value of the parameter.
- Returns:
The value of the parameter.
- Return type:
str
- is_read_only() bool#
Returns whether the parameter is read-only, i.e. whether its value cannot be updated by the user.
- Returns:
Trueif the parameter is read-only,Falseotherwise.- Return type:
bool
- set_value(value: str) None#
Sets the value of the parameter.
If the parameter is read-only, an exception is raised.
- Parameters:
value (str) – The new value of the parameter.
- Return type:
None
- class spacepy.Preference#
Bases:
objectA
Preferenceis a setting in the SpaceStudio environment that can be manipulated. It can be architecture-specific or global to the whole engine.- get_description() str#
Returns the description of the preference.
- Returns:
The description of the preference.
- Return type:
str
- get_name() str#
Returns the name of the preference.
- Returns:
The name of the preference.
- Return type:
str
- get_value() str#
Returns the value of the preference.
- Returns:
The value of the preference.
- Return type:
str
- restore_default() None#
Restores the default value(s) of the preference.
- Return type:
None
- set_value(*value: str) None#
Sets the value of the preference.
- Parameters:
value (str) – One or many new values. Some preferences may require multiple values to be set at the same time, in which case multiple values can be passed as arguments to this method. If the preference only requires a single value, only the first argument will be considered, and the rest will be ignored.
- Return type:
None
- class spacepy.Project#
Bases:
objectRepresents a SpaceStudio project, i.e. a set of solutions.
- clean() None#
Cleans the project.
Removes all generated files for all solutions of the project.
- Return type:
None
- close() None#
Closes the project.
- Return type:
None
- create_solution(solution_name: str) spacepy.Solution#
Creates a new solution with the given name in the project, and returns the created
Solutionobject.- Parameters:
solution_name (str) – The name of the solution to create.
- Returns:
The created
Solutionobject.- Return type:
- get_name() str#
Returns the name of the project.
- Returns:
The name of the project.
- Return type:
str
- get_solution(name: str) spacepy.Solution#
Returns the solution with the specified name contained in the project.
If no solution with the specified name exists, an exception is raised.
- Parameters:
name (str) – The name of the solution to return.
- Returns:
The solution with the specified name contained in the project.
- Return type:
- get_solutions() Iterable[spacepy.Solution]#
Returns a collection of the solutions contained in the project.
- Returns:
A collection of the solutions contained in the project.
- Return type:
Iterable[spacepy.Solution]
- remove_solution(solution_name: str) None#
Removes the solution with the given name from the project.
If no solution with the given name exists in the project, does nothing.
- Parameters:
solution_name (str) – The name of the solution to remove.
- Return type:
None
- save() None#
Saves the project.
- Return type:
None
- class spacepy.Solution#
Bases:
objectA solution consists of a set of modules, devices, and architectures.
- create_architecture(architecture_name: str) spacepy.Architecture#
Creates a new architecture with the given name in the solution, and returns the created
Architectureobject.- Parameters:
architecture_name (str) – The name of the architecture to create.
- Returns:
The created
Architectureobject.- Return type:
- create_device(device_name: str, is_master: bool) spacepy.Device#
Creates a new device with the given name in the solution, and returns the created
Deviceobject.- Parameters:
device_name (str) – The name of the device to create.
is_master (bool) – Whether the device is a master device (i.e. initiates communications with other devices) or a slave device (i.e. only responds to communications initiated by other devices).
- Returns:
The created
Deviceobject.- Return type:
- create_module(module_name: str) spacepy.Module#
Creates a new module with the given name in the solution, and returns the created
Moduleobject.- Parameters:
module_name (str) – The name of the module to create.
- Returns:
The created
Moduleobject.- Return type:
- get_architecture(name: str) spacepy.Architecture#
Returns the architecture with the specified name contained in the solution.
If no architecture with the specified name exists, an exception is raised.
- Parameters:
name (str) – The name of the architecture to return.
- Returns:
The architecture with the specified name contained in the solution.
- Return type:
- get_architectures() Iterable[spacepy.Architecture]#
Returns a collection of the architectures contained in the solution.
- Returns:
A collection of the architectures contained in the solution.
- Return type:
Iterable[spacepy.Architecture]
- get_device(name: str) spacepy.Device#
Returns the device with the specified name contained in the solution.
If no device with the specified name exists, an exception is raised.
- Parameters:
name (str) – The name of the device to return.
- Returns:
The device with the specified name contained in the solution.
- Return type:
- get_devices() Iterable[spacepy.Device]#
Returns a collection of the devices contained in the solution.
- Returns:
A collection of the devices contained in the solution.
- Return type:
Iterable[spacepy.Device]
- get_linker_build_option(name: str) spacepy.ToolchainBuildOption#
Returns the linker build option with the given name.
If no linker build option with the given name exists for the solution, an exception is raised.
- Parameters:
name (str) – The name of the linker build option to return.
- Returns:
The linker build option with the given name.
- Return type:
- get_linker_build_options() Iterable[spacepy.ToolchainBuildOption]#
Returns a collection of the linker build options for the solution.
- Returns:
A collection of the linker build options for the solution.
- Return type:
Iterable[spacepy.ToolchainBuildOption]
- get_module(name: str) spacepy.Module#
Returns the module with the specified name contained in the solution.
If no module with the specified name exists, an exception is raised.
- Parameters:
name (str) – The name of the module to return.
- Returns:
The module with the specified name contained in the solution.
- Return type:
- get_modules() Iterable[spacepy.Module]#
Returns a collection of the modules contained in the solution.
- Returns:
A collection of the modules contained in the solution.
- Return type:
Iterable[spacepy.Module]
- get_name() str#
Returns the name of the solution.
- Returns:
The name of the solution.
- Return type:
str
- remove_architecture(architecture_name: str) None#
Removes the architecture with the given name from the solution.
If no architecture with the given name exists in the solution, does nothing.
- Parameters:
architecture_name (str) – The name of the architecture to remove.
- Return type:
None
- remove_device(device_name: str) None#
Removes the device with the given name from the solution.
If no device with the given name exists in the solution, does nothing.
- Parameters:
device_name (str) – The name of the device to remove.
- Return type:
None
- remove_module(module_name: str) None#
Removes the module with the given name from the solution.
If no module with the given name exists in the solution, does nothing.
- Parameters:
module_name (str) – The name of the module to remove.
- Return type:
None
- save() None#
Saves the solution.
- Return type:
None
- class spacepy.ToolchainBuildOption#
Bases:
objectA
ToolchainBuildOptioncorresponds to a build option made of flags and directories. It can be associated with the linker and be specific to a solution, or be associated with the compiler and be specific to a module or device.- add_directory(file_path: str) None#
Adds a directory to the build option.
- Parameters:
file_path (str) – The absolute path to the directory to add.
- Return type:
None
- get_directories() Iterable[str]#
Returns a collection of the directories of the build option.
- Returns:
A collection of the directories of the build option.
- Return type:
Iterable[str]
- get_flags() str#
Returns the flags of the build option, as a single string.
- Returns:
The flags of the build option, as a single string.
- Return type:
str
- get_name() str#
Returns the name of the build option.
- Returns:
The name of the build option.
- Return type:
str
- remove_directory(file_path: str) None#
Removes a directory from the build option.
- Parameters:
file_path (str) – The absolute path to the directory to remove.
- Return type:
None
- set_flags(flags: str) None#
Sets the flags of the build option.
- Parameters:
flags (str) – The new flags of the build option, as a single string.
- Return type:
None
- class spacepy.VLNV#
Bases:
objectUnique identifier for an IP core.
- get_library() str#
Returns the library field of the VLNV.
- Returns:
The library field of the VLNV.
- Return type:
str
- get_name() str#
Returns the name field of the VLNV.
- Returns:
The name field of the VLNV.
- Return type:
str
- get_vendor() str#
Returns the vendor field of the VLNV.
- Returns:
The vendor field of the VLNV.
- Return type:
str
- get_version() spacepy.Version#
Returns the version field of the VLNV.
- Returns:
The version field of the VLNV, as a
Versionobject.- Return type:
- class spacepy.Version#
Bases:
objectA version represented in a major.minor.patch format, where all three fields can be any string.
Note : the
Versionobject returned byEngine.get_version()has additional guarantees, seeEngine.get_version()documentation for details.- get_major() str#
Returns the major field of the version.
- Returns:
The major field of the version. Can be any alphanumeric string.
- Return type:
str
- get_minor() str#
Returns the minor field of the version.
- Returns:
The minor field of the version. Can be any alphanumeric string.
- Return type:
str
- get_patch() str#
Returns the patch field of the version.
- Returns:
The patch field of the version. Can be any alphanumeric string.
- Return type:
str
- class spacepy.Workflow#
Bases:
objectRepresents an executable process within SpaceStudio, namely : simulation, FPGA estimation, architecture implementation and FPGA-in-the-loop.
A Workflow is configured through named parameters. A detailed description of the parameters available for each workflow type can be found in Workflow Parameters.
- execute() Iterable[spacepy.Metric]#
Executes the workflow, and returns a collection of
Metricobjects representing the metrics resulting from the execution.- Returns:
A collection of
Metricobjects representing the metrics resulting from the execution.- Return type:
Iterable[spacepy.Metric]
- get_build_type() str#
Returns the build type of the workflow, as a string.
- Returns:
The build type of the workflow, as a string. One of {
"debug","monitoring"}.- Return type:
str
- get_parameter(parameter_name: str) spacepy.Parameter#
Returns the parameter with the specified name belonging to the workflow.
If no parameter with the specified name exists, an exception is raised.
A detailed description of the parameters available for each workflow type can be found in Workflow Parameters.
- Parameters:
parameter_name (str) – The name of the parameter to return.
- Returns:
The parameter with the specified name belonging to the workflow.
- Return type:
- get_parameters() Iterable[spacepy.Parameter]#
Returns a collection of all the parameters defined for the workflow.
A detailed description of the parameters available for each workflow type can be found in Workflow Parameters.
- Returns:
A collection of all the parameters defined for the workflow.
- Return type:
Iterable[spacepy.Parameter]
- get_workflow_type() str#
Returns the type of the workflow, as a string.
- Returns:
The type of the workflow, as a string. One of {
"simulation","estimation","implementation","fpga-in-the-loop"}.- Return type:
str