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.
-
mbtype
¶ The defined type of the microblaze subsystem. Used by driver programs to limit what microblaze subsystems the program is run on. The Pynq-Z1 base overlay has ‘Ardiuno’ and ‘Pmod’ microblaze types.
-
-
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
¶ str – The name of the IP corresponding to the Microblaze.
-
rst_name
¶ str – The name of the reset pin for the Microblaze.
-
mb_program
¶ str – The absolute path of the Microblaze program.
-
state
¶ str – The status (IDLE, RUNNING, or STOPPED) of the Microblaze.
-
reset_pin
¶ GPIO – The reset pin associated with the Microblaze.
-
mmio
¶ MMIO – The MMIO instance associated with the Microblaze.
-
interrupt
¶ Event – An asyncio.Event-like class for waiting on and clearing interrupts.
-
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.
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
¶ TypeWrapper – The type wrapper for the return type
-
arg_interfaces
¶ [TypeWrapper] – An array of type wrappers for the arguments
-
call_ast
¶ pycparser.c_ast – Syntax tree for the wrapped function call
-
-
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