Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Use Microblaze performance monitoring engine

Status
Not open for further replies.

giav

Newbie level 1
Joined
Apr 29, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
20
Hi,

I would like to use the MicroBlaze performance monitoring engine to collect some information on my application code running on the processor itself. I would need these information at application level. Xilinx proposes to collect low-level information by using XSDK "performance view": that is very clear, and it works good, but this type of solution drives to a partial use of the MicroBlaze performance monitoring engine, in the sense that among a large number of events that could be collected, only part of them can be read via XSDK.

To work with others, Xilinx offers the possibility to access to monitoring engine via MicroBlaze Debug Module (MDM): that would be a nice solution for my work.

In order to do these things, I have created a project with MicroBlaze and extended debug function, with 5 event counters and 1 latency counter.

Then I have inserted a MDM in my design and created an AXI4lite slave port to access from MicroBlaze itself. In this mode I should be able to access to internal performance monitoring engine by using DBG_CTRL and DBG_DATA registers indicated to page 12 of pg115 (MDM product guide), with values indicated on page 92 of MB reference guide (version 2015.04).

Suppose I need to measure number of any valid executed instruction, I have wrote the following C code:

Code:
/* some code before */
        unsigned int* dbg_ctrl=(unsigned int*)0x41400010;
	unsigned int* dbg_data=(unsigned int*)0x41400014;
	unsigned int* var_mon=(unsigned int*)0x82000000;
	unsigned int read_value=6;

    init_platform();
    xil_printf ("start \n\r");

    //set first register to be considered
    *dbg_ctrl=0x4a404;
    *dbg_data=1;

    //set event 0 (total instruction executed) to be monitored
    *dbg_ctrl=0x4a207;
    *dbg_data=0;

    //clear the value of all counters
    *dbg_ctrl=0x4a404;
    *dbg_data=16;

    //start monitoring action
    *dbg_ctrl=0x4a404;
    *dbg_data=8;
    //routine to be monitored
    * var_mon=5;
    * var_mon=6;

    //sample the value
    *dbg_ctrl=0x4a404;
    *dbg_data=2;

    //stop the monitoring action
    *dbg_ctrl=0x4a404;
    *dbg_data=4;

    //set first register to be considered
    *dbg_ctrl=0x4a404;
    *dbg_data=1;

    //read the result
    *dbg_ctrl=0x4ac1f;
    read_value=*dbg_data;

    xil_printf ("value is %d \n\r", read_value);

    cleanup_platform();

/*some code after */

The problem happens when I perform the write and read operations on *dbg_data: the read/write action on this variable does not give any response. The register pointed by variable is R/W, so it should work.

Do you have any suggestion about this wrong behaviour?

Thank you.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top