added debug print states or rtl

This commit is contained in:
Blaise Tine
2020-05-16 14:19:17 -04:00
parent 65c2da76cf
commit d6c87dbb0a
24 changed files with 7100 additions and 5980 deletions

View File

@@ -5,7 +5,7 @@
.type vx_wspawn, @function
.global vx_wspawn
vx_wspawn:
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
.word 0x00b5106b # wspawn a0(num_warps), a1(func_ptr)
ret
.type vx_tmc, @function
@@ -17,7 +17,7 @@ vx_tmc:
.type vx_barrier, @function
.global vx_barrier
vx_barrier:
.word 0x00b5406b # barrier a0(barrier id), a1(numWarps)
.word 0x00b5406b # barrier a0(barrier_id), a1(num_warps)
ret
.type vx_split, @function

View File

@@ -1,20 +1,18 @@
#ifndef VX_INTRINSICS
#define VX_INTRINSICS
#ifndef VX_INTRINSICS_H
#define VX_INTRINSICS_H
#ifdef __cplusplus
extern "C" {
#endif
// Spawn warps
void vx_wspawn(int numWarps, int PC_spawn);
void vx_wspawn(int num_warps, unsigned func_ptr);
// Set thread mask
void vx_tmc(int numThreads);
void vx_tmc(int num_threads);
// Warp Barrier
void vx_barrier(int barriedID, int numWarps);
void vx_barrier(int barried_id, int num_warps);
// Split on a predicate
void vx_split(int predicate);

View File

@@ -1,5 +1,5 @@
#pragma once
#ifndef VX_IO_H
#define VX_IO_H
#include <stdbool.h>
@@ -15,7 +15,8 @@ void vx_printf(const char *, unsigned);
void vx_print_str(const char *);
void vx_printc(unsigned, char c);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -625,7 +625,7 @@ Disassembly of section .text:
8000083c: 28d1a023 sw a3,640(gp) # 80016a88 <global_argument_struct>
80000840: 26b1ae23 sw a1,636(gp) # 80016a84 <global_num_threads>
80000844: 00100793 li a5,1
80000848: 00a7fa63 bgeu a5,a0,8000085c <vx_spawn_warps+0x38>
80000848: 00a7da63 bge a5,a0,8000085c <vx_spawn_warps+0x38>
8000084c: 800005b7 lui a1,0x80000
80000850: 7a058593 addi a1,a1,1952 # 800007a0 <__BSS_END__+0xfffe9c78>
80000854: d55ff0ef jal ra,800005a8 <vx_wspawn>

View File

@@ -132,7 +132,7 @@
:1008180013351500130101016FF01FD9130101FFF2
:100828002324810023229100232021012326110063
:1008380023A2C12823A0D12823AEB12693071000F4
:1008480063FAA700B70500809385057AEFF05FD5B6
:1008480063DAA700B70500809385057AEFF05FD5D6
:1008580083A5C12713850500EFF01FD503A501283F
:1008680083A74128E7800700EFF01FD60324810003
:100878008320C1008324410003290100133515009A

View File

@@ -9,7 +9,7 @@ extern "C" {
func_t global_function_pointer;
void * global_argument_struct;
unsigned global_num_threads;
int global_num_threads;
void spawn_warp_runonce() {
// active all threads
@@ -19,12 +19,12 @@ void spawn_warp_runonce() {
global_function_pointer(global_argument_struct);
// resume single-thread execution on exit
unsigned wid = vx_warp_id();
int wid = vx_warp_id();
unsigned tmask = (0 == wid) ? 0x1 : 0x0;
vx_tmc(tmask);
}
void vx_spawn_warps(unsigned numWarps, unsigned numThreads, func_t func_ptr, void * args) {
void vx_spawn_warps(int numWarps, int numThreads, func_t func_ptr, void * args) {
global_function_pointer = func_ptr;
global_argument_struct = args;
global_num_threads = numThreads;
@@ -34,7 +34,7 @@ void vx_spawn_warps(unsigned numWarps, unsigned numThreads, func_t func_ptr, voi
spawn_warp_runonce();
}
unsigned pocl_threads;
int pocl_threads;
struct context_t * pocl_ctx;
vx_pocl_workgroup_func pocl_pfn;
const void * pocl_args;

View File

@@ -1,6 +1,5 @@
#ifndef VX_API_
#define VX_API_
#ifndef VX_API_H
#define VX_API_H
#include <stdint.h>
#include <stdio.h>
@@ -11,7 +10,7 @@ extern "C" {
typedef void (*func_t)(void *);
void vx_spawn_warps(unsigned numWarps, unsigned numThreads, func_t func_ptr , void * args);
void vx_spawn_warps(int num_warps, int num_threads, func_t func_ptr , void * args);
struct context_t {
uint32_t num_groups[3];