add new (Tilelink2) RoCC accelerator interface
Includes configuration, test programs, and documentation updates.
This commit is contained in:
19
tests/charcount.c
Normal file
19
tests/charcount.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "rocc.h"
|
||||
|
||||
char string[64] = "The quick brown fox jumped over the lazy dog";
|
||||
|
||||
static inline unsigned long count_chars(char *start, char needle)
|
||||
{
|
||||
unsigned long count;
|
||||
asm volatile ("fence");
|
||||
ROCC_INSTRUCTION_DSS(2, count, start, needle, 0);
|
||||
return count;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned long count = count_chars(string + 14, 'o');
|
||||
if (count != 3)
|
||||
return count + 1;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user