pynq.lib.pynqmicroblaze.pynqmicroblaze Module¶
-
class
pynq.lib.pynqmicroblaze.pynqmicroblaze.
MBInterruptEvent
(intr_pin, intr_ack_gpio)[source]¶ Bases:
object
The class provides and asyncio Event-like interface to the interrupt subsystem for a Microblaze. The event is set by raising an interrupt and cleared using the clear function.
Typical use is to call clear prior to sending a request to the Microblaze and waiting in a loop until the response is received. This order of operations will avoid race conditions between the Microblaze and the host code.
-
class
pynq.lib.pynqmicroblaze.pynqmicroblaze.
MicroblazeHierarchy
(description, mbtype='Unknown')[source]¶ Bases:
pynq.overlay.DefaultHierarchy
Hierarchy driver for the microblaze subsystem.
Enables the user to load programs on to the microblaze. All function calls and member accesses are delegated to the loaded program.
-
static
checkhierarchy
(description)[source]¶ Function to check if the driver matches a particular hierarchy
This function should be redefined in derived classes to return True if the description matches what is expected by the driver. The default implementation always returns False so that drivers that forget don’t get loaded for hierarchies they don’t expect.
-
mbtype
¶ The defined type of the microblaze subsystem. Used by driver programs to limit what microblaze subsystems the program is run on.
-
static
-
class
pynq.lib.pynqmicroblaze.pynqmicroblaze.
PynqMicroblaze
(mb_info, mb_program, force=False)[source]¶ Bases:
object
This class controls the active Microblaze instances in the system.
-
ip_name
¶ The name of the IP corresponding to the Microblaze.
Type: str
-
rst_name
¶ The name of the reset pin for the Microblaze.
Type: str
-
mb_program
¶ The absolute path of the Microblaze program.
Type: str
-
state
¶ The status (IDLE, RUNNING, or STOPPED) of the Microblaze.
Type: str
-
interrupt
¶ An asyncio.Event-like class for waiting on and clearing interrupts.
Type: Event
-
program
()[source]¶ This method programs the Microblaze.
This method is called in __init__(); it can also be called after that. It uses the attribute self.mb_program to program the Microblaze.
Returns: Return type: None
-
read
(offset, length=1)[source]¶ This method reads data from the shared memory of Microblaze.
Parameters: - offset (int) – The beginning offset where data are read from.
- length (int) – The number of data (32-bit int) to be read.
Returns: An int of a list of data read from the shared memory.
Return type: int/list
-
reset
()[source]¶ Reset the Microblaze to stop it from running.
This method will update the status of the Microblaze.
Returns: Return type: None
-
pynq.lib.pynqmicroblaze.compile Module¶
-
class
pynq.lib.pynqmicroblaze.compile.
MicroblazeProgram
(mb_info, program_text, bsp=None)[source]¶ Bases:
pynq.lib.pynqmicroblaze.pynqmicroblaze.PynqMicroblaze
pynq.lib.pynqmicroblaze.rpc Module¶
-
class
pynq.lib.pynqmicroblaze.rpc.
ConstCharPointerWrapper
(type_)[source]¶ Bases:
pynq.lib.pynqmicroblaze.rpc.ConstPointerWrapper
Wrapper for const char*s which accepts Python strings and makes sure they are NULL-terminated
-
class
pynq.lib.pynqmicroblaze.rpc.
ConstPointerWrapper
(type_, struct_string)[source]¶ Bases:
object
Wrapper for const T pointers, transfers data in only one direction.
-
class
pynq.lib.pynqmicroblaze.rpc.
FuncAdapter
(decl, typedefs)[source]¶ Bases:
object
Provides the C and Python interfaces for a function declaration
-
return_interface
¶ The type wrapper for the return type
Type: TypeWrapper
-
arg_interfaces
¶ An array of type wrappers for the arguments
Type: [TypeWrapper]
-
call_ast
¶ Syntax tree for the wrapped function call
Type: pycparser.c_ast
-
-
class
pynq.lib.pynqmicroblaze.rpc.
FuncDefVisitor
[source]¶ Bases:
pycparser.c_ast.NodeVisitor
Primary visitor that parses out function definitions, typedes and enumerations from a syntax tree
-
class
pynq.lib.pynqmicroblaze.rpc.
MicroblazeFunction
(stream, index, function, return_type)[source]¶ Bases:
object
Calls a specific function
-
class
pynq.lib.pynqmicroblaze.rpc.
MicroblazeLibrary
(iop, libraries)[source]¶ Bases:
pynq.lib.pynqmicroblaze.rpc.MicroblazeRPC
Provides simple Python-only access to a set of Microblaze libraries.
The members of this class are determined by the libraries chosen and can determined either by using
dir
on the instance or the?
operator inside of IPython
-
class
pynq.lib.pynqmicroblaze.rpc.
MicroblazeRPC
(iop, program_text)[source]¶ Bases:
object
Provides a python interface to the Microblaze based on an RPC mechanism.
The attributes of the class are generated dynamically from the typedefs, enumerations and functions given in the provided source.
Functions are added as methods, the values in enumerations are added as constants to the class and types are added as classes.
-
class
pynq.lib.pynqmicroblaze.rpc.
ParsedEnum
[source]¶ Bases:
object
Holds the values of an enum from the C source
-
class
pynq.lib.pynqmicroblaze.rpc.
PointerWrapper
(type_, struct_string)[source]¶ Bases:
object
Wrapper for non-const T pointers that retrieves any data modified by the called function.
-
class
pynq.lib.pynqmicroblaze.rpc.
PrimitiveWrapper
(struct_string, type_)[source]¶ Bases:
object
Wrapper for C primitives that can be represented by a single Struct string.
pynq.lib.pynqmicroblaze.magic Module¶
pynq.lib.pynqmicroblaze.streams Module¶
-
class
pynq.lib.pynqmicroblaze.streams.
InterruptMBStream
(iop, read_offset=62464, write_offset=61440)[source]¶
-
class
pynq.lib.pynqmicroblaze.streams.
SimpleMBChannel
(buffer, offset=0, length=0)[source]¶ Bases:
object