cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sravanke
Observer
Observer
934 Views
Registered: ‎06-22-2015

AXI Master inference from CPP Design

Jump to solution

Hello,

There is a C++ design which needs to be done. The design is basically a state machine for controlling a control loop.

Here is the overall architecture in mind:

class Control_Loop:
-adc_val: int;
-controller_out: float;
+Control_Loop(); // constructor +void init(void); +void drive(); +void hold();

Each of the member functions init(), drive() and hold() need to access an RTL module through an AXI_MASTER interface. Now I read that pointers can be inferred as AXI_M interfaces using certain directives. Also some global variables can be used as a AXI_M interface as per the HLS document UG902.

My doubt is how to implement a AXI_M variable common to all the member functions? Can I use a member variable as an AXI_M interface in any way? Also how does the top module wrapper function have its use in AXI_M inference?

Appreciate any support on this.

Cheers,

sravanke

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
u4223374
Advisor
Advisor
898 Views
Registered: ‎04-26-2015

The first thing to recognize is that you get one (and only one) top-level function that's accessible to the outside world. You can't create a "hardware class" and then call different functions on it; instead you'll need a top function with a "mode select" input that tells it which of the sub-functions to run.

 

This provides a neat way to share an AXI Master. Just define the AXI Master as a pointer on the top function interface, and (depending on what the mode_select input says) pass it to one of the sub-functions.

View solution in original post

2 Replies
u4223374
Advisor
Advisor
899 Views
Registered: ‎04-26-2015

The first thing to recognize is that you get one (and only one) top-level function that's accessible to the outside world. You can't create a "hardware class" and then call different functions on it; instead you'll need a top function with a "mode select" input that tells it which of the sub-functions to run.

 

This provides a neat way to share an AXI Master. Just define the AXI Master as a pointer on the top function interface, and (depending on what the mode_select input says) pass it to one of the sub-functions.

View solution in original post

sravanke
Observer
Observer
882 Views
Registered: ‎06-22-2015
Thanks for the comment.
0 Kudos