Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b393e20
libHttp changes (#97)
bucanero Jul 2, 2020
30299eb
Simple HTTP example (#101)
bucanero Jul 3, 2020
766f6ac
- add libspumars (Multicore Application Runtime System). A library se…
Jul 7, 2020
a900e30
- add spumars sample
Jul 10, 2020
7751f85
- remove accidentally committed files.
Jul 10, 2020
9cfc242
- refactor blitting sample (to catchup psl1ght changes)
Jul 13, 2020
48a1ed7
- fix API changes
Jul 13, 2020
98a4d1d
- fix API changes
Jul 13, 2020
c155a33
- refactor and fix API changes
Jul 13, 2020
665c691
- refactor and fix API changes
Jul 13, 2020
216c381
- fix sample
Jul 14, 2020
e656d7d
- add .gitignore into data folder (hence "folder" is committed to git)
Jul 14, 2020
26ce402
- explicitly add spu.bin to BINFILES
Jul 14, 2020
a9d15cd
- update vectormath library
Jul 14, 2020
14a9969
- add libfont
Jul 14, 2020
ead0713
- add shader binaries to .gitignore
Jul 16, 2020
75c3c56
- add extended methods to jpgdec
Jul 16, 2020
62b372b
- improvements to the cg compiler
Jul 16, 2020
bcbd276
- add additional defines
Jul 16, 2020
f92c0f2
- proper const'ing
Jul 16, 2020
5cbcdbf
- add additional define
Jul 16, 2020
f0ec5e9
- changes according to the RSX/shader program API changes
Jul 16, 2020
99cd685
- add more advanced rsx test samples
Jul 17, 2020
288f8c7
- stay c99 compliant
Jul 17, 2020
37da6d6
- improve samples/fix aspect ratio
Jul 17, 2020
12c9978
- start support FP16 (half float precision)
Jul 17, 2020
d76e058
- use correct macro
Jul 17, 2020
ace7f47
- use correct macro
Jul 17, 2020
80cbc2a
- do not clobber a volatile register here (might be passed as argument)
Jul 17, 2020
ee9156b
Remove symbol dot from asm call to sbrk_deinit
zeldin Jul 17, 2020
08d3524
- revert 42952d76
Jul 18, 2020
1ffb278
- fix issue with functions having more than 8 arguments (as per spec …
Jul 19, 2020
14eb002
- simplify tile example
Jul 19, 2020
eaf6a3b
- add methods
Jul 19, 2020
0e320ab
- prepare macro to be able to handle argc <= 8 (preparation for later…
Jul 20, 2020
cf74d81
- no need to use an additional register here.
Jul 20, 2020
1ec4a17
- correct atomic.h
Jul 22, 2020
8c41cd0
- revert most changes and fix it a the right place
Jul 22, 2020
2a7b39f
- fix compile warnings
Jul 22, 2020
4441cb9
- also set BFC as output
Jul 25, 2020
869e265
Cairo clock example
crystalct Jul 27, 2020
9b7c7ce
add RSX basic example
Jan 22, 2021
2449900
Update Readme.md
crystalct Jan 22, 2021
24118d7
Update Readme.md
crystalct Jan 22, 2021
d6e350c
Update Readme.md
crystalct Jan 22, 2021
fcfbf6c
add RSX Basic Cube sample
crystalct Jan 24, 2021
e12643e
add data folder to RSX Basic Cube sample
crystalct Jan 25, 2021
83bce1d
fixed VIDEO_RESOLUTION_1080 inside rsxutil.cpp
crystalct Jan 25, 2021
9f1c338
fixed VIDEO_RESOLUTION_1080 inside rsxutil.cpp
crystalct Jan 25, 2021
f9351eb
Add files via upload
crystalct Jan 25, 2021
dc8f569
Add files via upload
crystalct Jan 25, 2021
4196a98
Update Readme.md
crystalct Jan 25, 2021
5b072d5
Update Readme.md
crystalct Jan 25, 2021
7ff7646
Update Readme.md
crystalct Jan 25, 2021
fb147a6
add RSX basic wallparer example
Jan 27, 2021
f7eda89
rsx_Basic_Wallpaper fixed
crystalct Mar 16, 2021
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
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,50 @@
*.elf
*.self
*.pkg
*.bin
*.o
*.a
*.d
*.so
*.dll
*.task
*.elf.map
*.fpo*
*.vpo*
build/
.idea/
.vscode/
common/libspumars/ppu/ppu/
common/libspumars/spu/spu/
ppu/sprx/libaudio/ppu/
ppu/sprx/libcamera/ppu/
ppu/sprx/libgcm_sys/ppu/
ppu/sprx/libgem/ppu/
ppu/sprx/libhttp/ppu/
ppu/sprx/libhttputil/ppu/
ppu/sprx/libio/ppu/
ppu/sprx/libjpgdec/ppu/
ppu/sprx/liblv2/ppu/
ppu/sprx/libnet/ppu/
ppu/sprx/libpngdec/ppu/
ppu/sprx/libresc/ppu/
ppu/sprx/libspurs/ppu/
ppu/sprx/liblv2dbg/ppu/
ppu/sprx/libnetctl/ppu/
ppu/sprx/libssl/ppu/
ppu/sprx/libsysfs/ppu/
ppu/sprx/libsysmodule/ppu/
ppu/sprx/libsysutil/ppu/
ppu/sprx/libusb/ppu/
ppu/sprx/libvdec/ppu/
ppu/sprx/libfont/ppu/
ppu/sprx/libfontFT/ppu/
tools/generic/bin2s
tools/cgcomp/cgcomp
tools/geohot/make_self
tools/geohot/make_self_npdrm
tools/geohot/package_finalize
tools/ps3load/ps3load
tools/raw2h/raw2h
tools/sprxlinker/sprxlinker
tools/fself/fself
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ endif
.PHONY: samples

all:
@$(MAKE) -C common --no-print-directory
@$(MAKE) -C ppu --no-print-directory
@$(MAKE) -C spu --no-print-directory
@$(MAKE) -C common --no-print-directory
@$(MAKE) -C tools --no-print-directory

samples:
Expand All @@ -33,15 +33,15 @@ install-socat:
@$(MAKE) -C tools install-socat --no-print-directory

install:
@$(MAKE) -C common install --no-print-directory
@$(MAKE) -C ppu install --no-print-directory
@$(MAKE) -C spu install --no-print-directory
@$(MAKE) -C common install --no-print-directory
@$(MAKE) -C tools install --no-print-directory

clean:
@$(MAKE) -C common clean --no-print-directory
@$(MAKE) -C ppu clean --no-print-directory
@$(MAKE) -C spu clean --no-print-directory
@$(MAKE) -C common clean --no-print-directory
@$(MAKE) -C tools clean --no-print-directory
@rm -rf doc

Expand Down
3 changes: 3 additions & 0 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
all:
@$(MAKE) -C libsimdmath --no-print-directory
@$(MAKE) -C vectormath --no-print-directory
@$(MAKE) -C libspumars --no-print-directory

install:
@$(MAKE) -C libsimdmath install --no-print-directory
@$(MAKE) -C vectormath install --no-print-directory
@$(MAKE) -C libspumars install --no-print-directory

clean:
@$(MAKE) -C libsimdmath clean --no-print-directory
@$(MAKE) -C vectormath clean --no-print-directory
@$(MAKE) -C libspumars clean --no-print-directory

.PHONY: all clean install
19 changes: 19 additions & 0 deletions common/libspumars/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------

all:
@$(MAKE) -C spu --no-print-directory
@$(MAKE) -C ppu --no-print-directory

install:
@$(MAKE) -C spu install --no-print-directory
@$(MAKE) -C ppu install --no-print-directory

clean:
@$(MAKE) -C spu clean --no-print-directory
@$(MAKE) -C ppu clean --no-print-directory

.PHONY: all clean install
22 changes: 22 additions & 0 deletions common/libspumars/base/common/callback_internal_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef __MARS_CALLBACK_INTERNAL_TYPES_H__
#define __MARS_CALLBACK_INTERNAL_TYPES_H__

#define MARS_CALLBACK_QUEUE_SIZE 128 /* size of 128 bytes */
#define MARS_CALLBACK_QUEUE_ALIGN 128 /* align to 128 bytes */
#define MARS_CALLBACK_QUEUE_MAX 54 /* max depth of queue */

#define MARS_CALLBACK_QUEUE_FLAG_NONE 0x0 /* no flag set */
#define MARS_CALLBACK_QUEUE_FLAG_EXIT 0x1 /* exit flag */
#define MARS_CALLBACK_QUEUE_FLAG_PUSH 0x2 /* push flag */

/* 128 byte callback queue structure */
struct mars_callback_queue {
uint32_t lock;
uint32_t flag;
uint32_t count;
uint32_t head;
uint32_t tail;
uint16_t workload_id[MARS_CALLBACK_QUEUE_MAX];
} __attribute__((aligned(MARS_CALLBACK_QUEUE_ALIGN)));

#endif
95 changes: 95 additions & 0 deletions common/libspumars/base/common/kernel_internal_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#ifndef __KERNEL_INTERNAL_TYPES_H__
#define __KERNEL_INTERNAL_TYPES_H__

#include <stdint.h>

#include "mars/mutex_types.h"

#include "callback_internal_types.h"
#include "workload_internal_types.h"

#define MARS_KERNEL_ID_NONE 0xffff

#define MARS_KERNEL_TICKS_FLAG_SYNC_BEGIN 0x1
#define MARS_KERNEL_TICKS_FLAG_SYNC_END 0x2

#define MARS_KERNEL_DMA_TAG 31
#define MARS_KERNEL_SPU_EVENT_PORT 63

#define MARS_KERNEL_PARAMS_SIZE 128
#define MARS_KERNEL_PARAMS_ALIGN 128

/* mars kernel syscalls */
struct mars_kernel_syscalls {
uint32_t (*get_ticks)(void);
uint64_t (*get_mars_context_ea)(void);
uint16_t (*get_kernel_id)(void);
uint16_t (*get_workload_id)(void);
struct mars_workload_context * (*get_workload)(void);
struct mars_workload_context * (*get_workload_by_id)(uint16_t id);

void (*workload_exit)(uint8_t state);
int (*workload_query)(uint16_t id, int query);
int (*workload_wait_set)(uint16_t id);
int (*workload_wait_reset)(void);
int (*workload_signal_set)(uint16_t id);
int (*workload_signal_reset)(void);
int (*workload_schedule_begin)(uint16_t id, uint8_t priority,
struct mars_workload_context **workload);
int (*workload_schedule_end)(uint16_t id, int cancel);
int (*workload_unschedule_begin)(uint16_t id,
struct mars_workload_context **workload);
int (*workload_unschedule_end)(uint16_t id);

void (*host_signal_send)(uint64_t watch_point_ea);
int (*host_callback_set)(uint64_t callback_ea,
const struct mars_callback_args *in);
int (*host_callback_reset)(struct mars_callback_args *out);

int (*mutex_lock_get)(uint64_t mutex_ea, struct mars_mutex *mutex);
int (*mutex_unlock_put)(uint64_t mutex_ea, struct mars_mutex *mutex);

int (*dma_get)(void *ls, uint64_t ea, uint32_t size, uint32_t tag);
int (*dma_put)(const void *ls, uint64_t ea, uint32_t size,
uint32_t tag);
int (*dma_wait)(uint32_t tag);
};

/* mars kernel ticks */
struct mars_kernel_ticks {
uint32_t flag;
uint32_t offset;
};

/* mars kernel parameters */
struct mars_kernel_params {
struct mars_kernel_ticks kernel_ticks;
uint64_t mars_context_ea;
uint64_t workload_queue_ea;
uint64_t callback_queue_ea;
uint16_t kernel_id;

uint8_t pad[MARS_KERNEL_PARAMS_SIZE -
(sizeof(struct mars_kernel_ticks) +
sizeof(uint64_t)*3 +
sizeof(uint16_t))
];
} __attribute__((aligned(MARS_KERNEL_PARAMS_ALIGN)));

/* mars kernel buffer */
union mars_kernel_buffer {
struct mars_callback_queue callback_queue;
struct mars_workload_queue_header workload_queue_header;
struct mars_workload_queue_block workload_queue_block;
};

/* mars kernel mutex */
int mutex_lock_get(uint64_t mutex_ea, struct mars_mutex *mutex);
int mutex_unlock_put(uint64_t mutex_ea, struct mars_mutex *mutex);

/* mars kernel dma */
int dma_get(void *ls, uint64_t ea, uint32_t size, uint32_t tag);
int dma_put(const void *ls, uint64_t ea, uint32_t size, uint32_t tag);
int dma_wait(uint32_t tag);

#endif
159 changes: 159 additions & 0 deletions common/libspumars/base/common/workload_internal_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
#ifndef __WORKLOAD_INTERNAL_TYPES_H__
#define __WORKLOAD_INTERNAL_TYPES_H__

#include <stdint.h>

#include "mars/callback_types.h"
#include "mars/workload_types.h"

#define MARS_WORKLOAD_STATE_NONE 0x00 /* workload undefined */
#define MARS_WORKLOAD_STATE_ADDING 0x01 /* adding now */
#define MARS_WORKLOAD_STATE_REMOVING 0x02 /* removing now */
#define MARS_WORKLOAD_STATE_SCHEDULING 0x04 /* scheduling now */
#define MARS_WORKLOAD_STATE_UNSCHEDULING 0x08 /* unscheduling now */
#define MARS_WORKLOAD_STATE_READY 0x10 /* ready to schedule */
#define MARS_WORKLOAD_STATE_WAITING 0x20 /* waiting for sync */
#define MARS_WORKLOAD_STATE_RUNNING 0x40 /* currently running */
#define MARS_WORKLOAD_STATE_FINISHED 0x80 /* not allow schedule */

#define MARS_WORKLOAD_PRIORITY_MIN 0x00 /* minimum priority */
#define MARS_WORKLOAD_PRIORITY_MAX 0xff /* maximum priority */

#define MARS_WORKLOAD_COUNTER_MIN 0x0000 /* minimum counter */
#define MARS_WORKLOAD_COUNTER_MAX 0x7fff /* maximum counter */

#define MARS_WORKLOAD_SIGNAL_OFF 0x0 /* signal set off */
#define MARS_WORKLOAD_SIGNAL_ON 0x1 /* signal set on */

#define MARS_WORKLOAD_ID_NONE 0xffff /* workload id none */
#define MARS_WORKLOAD_ID_MAX 799 /* workload id max */

#define MARS_WORKLOAD_PER_BLOCK 16 /* wl/block (lock+15) */
#define MARS_WORKLOAD_NUM_BLOCKS 50 /* total blocks */
#define MARS_WORKLOAD_MAX 750 /* blocks * wl/block */

#define MARS_WORKLOAD_QUEUE_SIZE 198528 /* size 198528 bytes */
#define MARS_WORKLOAD_QUEUE_ALIGN 128 /* align to 128 bytes */
#define MARS_WORKLOAD_QUEUE_HEADER_SIZE 128 /* size of 128 bytes */
#define MARS_WORKLOAD_QUEUE_HEADER_ALIGN 128 /* align to 128 bytes */
#define MARS_WORKLOAD_QUEUE_BLOCK_SIZE 128 /* size to 128 bytes */
#define MARS_WORKLOAD_QUEUE_BLOCK_ALIGN 128 /* align to 128 bytes */

#define MARS_WORKLOAD_QUEUE_FLAG_NONE 0x0 /* no flag set */
#define MARS_WORKLOAD_QUEUE_FLAG_EXIT 0x1 /* exit flag */

#define MARS_WORKLOAD_BLOCK_PRIORITY_MIN MARS_WORKLOAD_PRIORITY_MIN
#define MARS_WORKLOAD_BLOCK_PRIORITY_MAX MARS_WORKLOAD_PRIORITY_MAX

#define MARS_WORKLOAD_BLOCK_COUNTER_MIN 0x00
#define MARS_WORKLOAD_BLOCK_COUNTER_MAX 0x3f

#define MARS_WORKLOAD_BLOCK_READY_OFF 0x0
#define MARS_WORKLOAD_BLOCK_READY_ON 0x1

#define MARS_WORKLOAD_BLOCK_WAITING_OFF 0x0
#define MARS_WORKLOAD_BLOCK_WAITING_ON 0x1
/*
* MARS workload queue header block bits (16-bits)
* ------------------------------------------
* |[15.....8]|[7.....2]|[ 1 ]|[ 0 ]|
* ------------------------------------------
* | 8-bits | 6-bits | 1-bit | 1-bit |
* ------------------------------------------
* | PRIORITY | COUNTER | READY | WAITING |
* ------------------------------------------
*/
#define MARS_BITS_SHIFT_BLOCK_PRIORITY 8
#define MARS_BITS_SHIFT_BLOCK_COUNTER 2
#define MARS_BITS_SHIFT_BLOCK_READY 1
#define MARS_BITS_SHIFT_BLOCK_WAITING 0

#define MARS_BITS_MASK_BLOCK_PRIORITY 0x000000000000ff00ULL
#define MARS_BITS_MASK_BLOCK_COUNTER 0x00000000000000fcULL
#define MARS_BITS_MASK_BLOCK_READY 0x0000000000000002ULL
#define MARS_BITS_MASK_BLOCK_WAITING 0x0000000000000001ULL

/*
* MARS workload queue block workload bits (64-bits)
* ------------------------------------------------------------------
* |[63....56]|[55....48]|[47....33]|[ 32 ]|[31.....16]|[15......0]|
* ------------------------------------------------------------------
* | 8-bits | 8-bits | 15-bits | 1-bit | 16-bits | 16-bits |
* ------------------------------------------------------------------
* | STATE | PRIORITY | COUNTER | SIGNAL | WAIT_ID | KERNEL_ID |
* ------------------------------------------------------------------
*/
#define MARS_BITS_SHIFT_WORKLOAD_STATE 56
#define MARS_BITS_SHIFT_WORKLOAD_PRIORITY 48
#define MARS_BITS_SHIFT_WORKLOAD_COUNTER 33
#define MARS_BITS_SHIFT_WORKLOAD_SIGNAL 32
#define MARS_BITS_SHIFT_WORKLOAD_WAIT_ID 16
#define MARS_BITS_SHIFT_WORKLOAD_KERNEL_ID 0

#define MARS_BITS_MASK_WORKLOAD_STATE 0xff00000000000000ULL
#define MARS_BITS_MASK_WORKLOAD_PRIORITY 0x00ff000000000000ULL
#define MARS_BITS_MASK_WORKLOAD_COUNTER 0x0000fffe00000000ULL
#define MARS_BITS_MASK_WORKLOAD_SIGNAL 0x0000000100000000ULL
#define MARS_BITS_MASK_WORKLOAD_WAIT_ID 0x00000000ffff0000ULL
#define MARS_BITS_MASK_WORKLOAD_KERNEL_ID 0x000000000000ffffULL

#define MARS_HOST_SIGNAL_EXIT 0x0 /* host exit flag */

#define MARS_WORKLOAD_MODULE_SIZE 64
#define MARS_WORKLOAD_MODULE_ALIGN 16

#define MARS_WORKLOAD_CALLBACK_SIZE 64
#define MARS_WORKLOAD_CALLBACK_ALIGN 16

#define MARS_BITS_GET(bits, name) \
((*(bits)&MARS_BITS_MASK_##name)>>MARS_BITS_SHIFT_##name)

#define MARS_BITS_SET(bits, name, val) \
(*bits) = ((*(bits)&~MARS_BITS_MASK_##name) | \
((uint64_t)(val)<<MARS_BITS_SHIFT_##name))

/* 128 byte workload queue header structure */
struct mars_workload_queue_header {
uint32_t lock;
uint32_t access;
uint64_t queue_ea;
uint64_t context_ea;
uint32_t flag;
uint16_t bits[MARS_WORKLOAD_NUM_BLOCKS];
} __attribute__((aligned(MARS_WORKLOAD_QUEUE_HEADER_ALIGN)));

/* 128 byte workload queue block structure */
struct mars_workload_queue_block {
/* bits[0] reserved for mutex lock */
uint64_t bits[MARS_WORKLOAD_PER_BLOCK];
} __attribute__((aligned(MARS_WORKLOAD_QUEUE_BLOCK_ALIGN)));

/* mars workload queue structure */
struct mars_workload_queue {
struct mars_workload_queue_header header;
struct mars_workload_queue_block block[MARS_WORKLOAD_NUM_BLOCKS];
struct mars_workload_context context[MARS_WORKLOAD_MAX];
} __attribute__((aligned(MARS_WORKLOAD_QUEUE_ALIGN)));

/* mars workload module structure */
struct mars_workload_module {
uint64_t text_ea;
uint64_t data_ea;
uint32_t text_vaddr;
uint32_t data_vaddr;
uint32_t text_size;
uint32_t data_size;
uint32_t bss_size;
uint32_t entry;
uint8_t name[MARS_WORKLOAD_MODULE_NAME_LEN_MAX + 1];
} __attribute__((aligned(MARS_WORKLOAD_MODULE_ALIGN)));

/* mars workload callback structure */
struct mars_workload_callback {
struct mars_callback_args callback_args;
uint64_t callback_ea;
uint32_t callback_ret;
uint32_t pad;
} __attribute__((aligned(MARS_WORKLOAD_CALLBACK_ALIGN)));

#endif
Loading