UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
4,569 Views
Registered: ‎08-21-2010

Measuring execution time in seconds (or ms) in Microblaze

Jump to solution

Hi all:

 

I'm trying to measure the execution time of the example Dhrystone benchmark program that came with the ISE installation on a Microblaze based embedded system running on a XUPV5 FPGA. 

 

So far I have create an XPS timer and measured the timer ticks that it takes to complete the benchmark program, now what I need is to convert the timer ticks to a value in seconds. 

 

I was looking around for the timer period that is used by the XPS timer and unfortunately I did not have much luck. I'm guessing that to determine the time in seconds I would have to multiply the timer ticks that I got with the PLB clock period. In the design that I'm using the PLB clock for the timer is set to be 125MHz, here is an excerpt from the .mhs file:

 

 

BEGIN plb_v46
 PARAMETER INSTANCE = mb_plb
 PARAMETER HW_VER = 1.04.a
 PORT PLB_Clk = clk_125_0000MHzPLL0
 PORT SYS_Rst = sys_bus_reset
END

 

BEGIN plb_v46 

PARAMETER INSTANCE = mb_plb 

PARAMETER HW_VER = 1.04.a 

PORT PLB_Clk = clk_125_0000MHzPLL0 

PORT SYS_Rst = sys_bus_reset

END

 

The synthesis produced a system that can run at 84.94 MHz. So I'm wondering is the PLB clock actually 125MHz.

 

I'm quite new to FPGAs so I'm sorry if I sounds like a newbie. Any help is always much appreciated. 

 

Thanks,

Chamira. 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
5,614 Views
Registered: ‎10-01-2008

Re: Measuring execution time in seconds (or ms) in Microblaze

Jump to solution

Hi Chamira,

 

No, you don't need to simulate the design in order to know the clock frequency. If you are using a clock_generator for synthesizing the clock, you should quite easily identify what clock frequency is set for the output.

 

For example, this is the clock_generator instantiation for one of my ML505 project.

 

 

BEGIN clock_generator
 PARAMETER INSTANCE = clock_generator_0
 PARAMETER C_EXT_RESET_HIGH = 0
 PARAMETER C_CLKIN_FREQ = 100000000
 PARAMETER C_CLKOUT0_FREQ = 125000000
 PARAMETER C_CLKOUT0_PHASE = 0
 PARAMETER C_CLKOUT0_GROUP = NONE
 PARAMETER C_CLKOUT0_BUF = TRUE
 PARAMETER HW_VER = 3.02.a
 PORT CLKIN = dcm_clk_s
 PORT CLKOUT0 = clk_125_0000MHz
 PORT RST = sys_rst_s
 PORT LOCKED = Dcm_all_locked
END

 

In this case, my CLKOUT0 output is set to 125MHz according to the value in C_CLKOUT0_FREQ parameter.

 

Hope this will clarify the issue.

 

Thanks,

Yan Shun Li

 

0 Kudos
4 Replies
Explorer
Explorer
4,555 Views
Registered: ‎10-01-2008

Re: Measuring execution time in seconds (or ms) in Microblaze

Jump to solution

Hi,

 

The frequency denoted in the name of the signal could be different to the actual frequency that you are running on the bus. I would recommend checking the clock generator to find out the actual frequency for the clk_125_0000MHzPLL0 clock path.

 

And yes, you are right. The unit of the counter in xps_timer is the PLB clock period. Once you find out what frequency you are running the bus at, you can then determine the toal time stored in the timer's counter register.

 

Hope it helps.

 

- Yan Shun Li

0 Kudos
4,539 Views
Registered: ‎08-21-2010

Re: Measuring execution time in seconds (or ms) in Microblaze

Jump to solution

Thank you Yan for your reply. If you don't mind me asking how can I go about and check the what the clock generator outputs?Would I have to run a digital simulation? 

 

Thanks again, 

 

Chamira. 

0 Kudos
Highlighted
Explorer
Explorer
5,615 Views
Registered: ‎10-01-2008

Re: Measuring execution time in seconds (or ms) in Microblaze

Jump to solution

Hi Chamira,

 

No, you don't need to simulate the design in order to know the clock frequency. If you are using a clock_generator for synthesizing the clock, you should quite easily identify what clock frequency is set for the output.

 

For example, this is the clock_generator instantiation for one of my ML505 project.

 

 

BEGIN clock_generator
 PARAMETER INSTANCE = clock_generator_0
 PARAMETER C_EXT_RESET_HIGH = 0
 PARAMETER C_CLKIN_FREQ = 100000000
 PARAMETER C_CLKOUT0_FREQ = 125000000
 PARAMETER C_CLKOUT0_PHASE = 0
 PARAMETER C_CLKOUT0_GROUP = NONE
 PARAMETER C_CLKOUT0_BUF = TRUE
 PARAMETER HW_VER = 3.02.a
 PORT CLKIN = dcm_clk_s
 PORT CLKOUT0 = clk_125_0000MHz
 PORT RST = sys_rst_s
 PORT LOCKED = Dcm_all_locked
END

 

In this case, my CLKOUT0 output is set to 125MHz according to the value in C_CLKOUT0_FREQ parameter.

 

Hope this will clarify the issue.

 

Thanks,

Yan Shun Li

 

0 Kudos
4,508 Views
Registered: ‎08-21-2010

Re: Measuring execution time in seconds (or ms) in Microblaze

Jump to solution

Thank you Yan, yes this does solve my problem. I also do use the clock generator module in my design and statements that are there in my MHS file look exactly the same. 

 

Best regards,

Chamira. 

0 Kudos