add new (Tilelink2) RoCC accelerator interface

Includes configuration, test programs, and documentation updates.
This commit is contained in:
Howard Mao
2017-06-22 16:43:14 -07:00
parent 634cad9e78
commit 9a9ebea207
7 changed files with 214 additions and 11 deletions

19
tests/charcount.c Normal file
View 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;
}