mutiple fixes: parallel printf, fixed cycle in cache, opencl refactored vecadd and sgemm, regen opencl kernels with hard-float, fixed vortex io bus interface, fixed dpi floats APi to support multicore mode, make vlsim multicore default, make rtlsim multi-core default, removed POCL binaries from repository, updated Makefiles to use external POCL

This commit is contained in:
Blaise Tine
2020-09-19 14:45:42 -04:00
parent 80f929eb61
commit f6f95e0c46
146 changed files with 116779 additions and 194258 deletions

View File

@@ -1,30 +1,14 @@
#include <VX_config.h>
.type vx_print_str, @function
.global vx_print_str
vx_print_str:
addi sp, sp, -12
sw ra, 0(sp)
sw a1, 4(sp)
bl:
lbu a1,0(a0)
beqz a1,be
jal vx_printc
addi a0, a0, 1
j bl
be:
lw ra, 0(sp)
lw a1, 4(sp)
addi sp, sp, 12
ret
.type vx_printc, @function
.global vx_printc
vx_printc:
.type vx_putchar, @function
.global vx_putchar
vx_putchar:
la t0, print_addr
lw t0, 0(t0)
sw a1, 0(t0)
csrr t1, CSR_GTID
slli t1, t1, 16
or t1, t1, a0
sw t1, 0(t0)
ret
.section .data

View File

@@ -1,38 +1,165 @@
#include <vx_print.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
static char * hextoa[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
void vx_print_hex(unsigned f)
{
// vx_print_str(hextoa[f]);
if (f < 16)
{
vx_print_str(hextoa[f]);
return;
static const char* skip_flags(const char* format) {
for (;;) {
int c = *format++;
switch (c) {
case '-':
case '+':
case ' ':
case '#': break;
default : {
return --format;
}
}
}
int temp;
int sf = 32;
bool start = false;
do
{
temp = (f >> (sf - 4)) & 0xf;
if (temp != 0) start = true;
if (start) vx_print_str(hextoa[temp]);
sf -= 4;
} while(sf > 0);
return NULL;
}
static const char* skip_width(const char* format) {
if (*format == '*') {
++format;
} else {
char *endptr;
strtol(format, &endptr, 10);
format = endptr;
}
return format;
}
void vx_printf(const char * c, unsigned f)
{
vx_print_str(c);
vx_print_hex(f);
vx_print_str("\n");
static const char* skip_precision(const char* format) {
if (*format == '.') {
++format;
if (*format == '*') {
++format;
} else {
char *endptr;
strtol(format, &endptr, 10);
format = endptr;
}
}
return format;
}
static const char* skip_modifier(const char* format) {
switch (*format) {
case 'h':
format++;
if (*format == 'h') {
format++;
}
break;
case 'l':
++format;
if (*format == 'l') {
++format;
}
break;
case 'j':
case 'z':
case 't':
case 'L':
++format;
break;
default:
break;
}
return format;
}
static const char* parse_format(const char* format, va_list va) {
char buffer[64];
char fmt[64];
const char* p = format;
p = skip_flags(p);
p = skip_width(p);
p = skip_precision(p);
p = skip_modifier(p);
++p;
int i;
fmt[0] = '%';
for (i = 0; i < (p - format); ++i) {
fmt[i+1] = format[i];
}
fmt[i+1] = 0;
int len = vsnprintf(buffer, 256, fmt, va);
for (i = 0; i < len; ++i) {
vx_putchar(buffer[i]);
}
return p;
}
int vx_vprintf(const char* format, va_list va) {
if (format == NULL)
return -1;
const char* p = format;
int c = *p++;
while (c) {
if (c == '%') {
p = parse_format(p, va);
c = *p++;
} else {
vx_putchar(c);
c = *p++;
}
}
return (int)(p - format);
}
int vx_printf(const char * format, ...) {
va_list va;
va_start(va, format);
int ret = vx_vprintf(format, va);
va_end(va);
return ret;
}
static const char hextoa[] = "0123456789abcdef";
void vx_prints(const char * str) {
int c = *str++;
while (c) {
vx_putchar(c);
c = *str++;
}
}
void vx_printx(unsigned value) {
if (value < 16) {
vx_putchar(hextoa[value]);
} else {
int i = 32;
bool start = false;
do {
int temp = (value >> (i - 4)) & 0xf;
if (temp != 0)
start = true;
if (start)
vx_putchar(hextoa[temp]);
i-= 4;
} while (i != 0);
}
vx_putchar('\n');
}
void vx_printv(const char * str, unsigned value) {
vx_prints(str);
vx_printx(value);
}
#ifdef __cplusplus