Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a simple cycle count report to dhrystone #566

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cv32e40x/tests/programs/custom/dhrystone/dhrystone.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@

/* Compiler and system dependent definitions: */

// mm_ram cycle counter address
#define TICKS_ADDR (*((volatile uint32_t*)0x15001004))

#define Mic_secs_Per_Second 1000000.0
/* Berkeley UNIX C returns process times in seconds/HZ */
Expand Down Expand Up @@ -596,7 +598,8 @@ int main (int argc, char *argv[])

printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);


// reset cycle counter
TICKS_ADDR = 0;

for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
{
Expand Down Expand Up @@ -693,6 +696,8 @@ int main (int argc, char *argv[])

} /* loop "for Run_Index" */

//record cycle counter
uint32_t cycle_cnt = TICKS_ADDR;

printf ("Execution ends%c", '\n');
printf (" %c", '\n');
Expand Down Expand Up @@ -746,6 +751,8 @@ int main (int argc, char *argv[])
printf ("Str_2_Loc: %s\n", Str_2_Loc);
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING%c", '\n');

printf ("Cycle count is %d \n", cycle_cnt);




Expand Down