Commit f43c9199 authored by Marc's avatar Marc
Browse files

changes in the test software to include assembler instructions for the custom ISA extension

parent 7a9d3dcc
S00C000070726F6D2E737265635A
S113000081D8200003000004821060E08188400051
S1130010819000008198000081800000A180000090
S113002001000000030020408210600FC2A00040C5
S11300308410000001000000010000000100000025
S11300400100000001000000801080020100000097
S11300500100000001000000010000000100000098
S1130060874440008608E01F881000008A100000C2
S11300708C1000008E100000A0100000A2100000E0
S1130080A4100000A6100000A8100000AA10000090
S1130090AC100000AE1000009010000092100000A0
S11300A09410000096100000981000009A100000B0
S11300B09C1000009E10000086A0E00116BFFFEF18
S11300C081E00000821020028190400003000004BF
S11300D0821060E0818840000100000001000000FF
S11300E001000000834800008330600C80886001B8
S11300F00280002401000000070000008610E1785F
S1130100C108C000C118C000C518C000C918C0008B
S1130110CD18C000D118C000D518C000D918C0002F
S1130120DD18C000E118C000E518C000E918C000DF
S1130130ED18C000F118C000F518C000F918C0008F
S1130140FD18C000010000000100000001000000D3
S1130150010000000100000089A008420100000025
S113016001000000010000000100000010800005F3
S11301700100000001000000000000000000000079
S1130180874440008730E01C8688E00F1280001C02
S1130190010000000320000005040E008410A233B7
S11301A0C42040000539A89B8410A260C4206004C8
S11301B0050003FCC42060080320000082106100D5
S11301C0C020600C84102003C420600882103860B2
S11301D0C40040008530A00C0300000482106009B4
S11301E080A0400212800006033FFC0082106100E0
S11301F00539A81B8410A260C420400005000080BB
S11302008210000080A0E0000280000501000000D0
S11302108200400210BFFFFC8620E0013D1003FF76
S1130220BC17A3E0BC2780019C27A060031000003A
S113023081C0400001000000010000000100000036
S113024000000000000000000000000000000000AA
S9030000FC
This diff is collapsed.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//This is a simple test, since the compiler support is not provided
//It is necessary to modify the srec file by hand
int main()
{
int a,b,c;
//test nop
a = 0x01020304;
b = 0x00010203;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
//nop 82488001
printf("NOP (move) c=%#010x, expected 0x01020304 mask 1111\n", c);
//test add
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
//add a b
printf("add: c=%#010x, expected result 0x01030507 mask 1111\n", c);
//test sadd
a=0x8180ff01;
b=0x81ff7f7f;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 0000
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("sadd: c=%#010x, expected result 0x8180ff01 mask 0000\n", c);
//test sub
a=0x0a0a0a0a;
b=0x00050a0b;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("sub: c=%#010x, expected result 0x0a0a0a0a mask 0000\n", c);
//test ssub
a=0x807f0afb;
b=0x05fffb0a;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 0001
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("ssub: c=%#010x, expected result 0x807f0af1 mask 0001\n", c);
//test Max MAX signed
a=0x0204080a;
b=0x204080a0;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 1011
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("signed max max: c=%#010x, expected result 0x00000020 mask 1011\n", c);
//test Max MAX unsigned
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 1110
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("unsigned max max: c=%#010x, expected result 0x00000080 mask 1110\n", c);
//test Min MIN unsigned
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 1111
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("unsigned min min: c=%#010x, expected result 0x00000002 mask 1111\n", c);
//test Min MIN signed
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 1100
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("signed min min: c=%#010x, expected result 0x00000002 mask 1100\n", c);
//test dot product
a=0x01020304;
b=0x00010203;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//1010
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("dot product: c=%#010x, expected result 0x0000000C mask 1010\n", c);
//test dot product2
a=0xfffe03fc;
b=0x00ff0203;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("dot product2: c=%#010x, expected result 0x00000000 mask 1010\n", c);
//test saturated mul
a=0x7f7ffdff;
b=0x7fff7f80;
//c=0x7f81807f
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("saturate mul: c=%#010x, expected result 0x7f7f80ff mask 1010\n",c);
//test div
a=0x40404040;
b=0x01020040;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 1111
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("div: c=%#010x, expected result 0x4020ff01 mask 1111\n", c);
//test div2
a=0xF6F6F6F6;
b=0x0102ff0a;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("div2: c=%#010x, expected result 0xf6fb0aff mask 1111\n", c);
//test nand as not (a nand a = !a)
a=0xdeadbeaf;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
//mask 0011
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("nand: c=%#010x, expected result 0xDEAD4150 mask 0011\n", c);
//test xor reduction
a=0xfeedcafe;
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
printf("xor reduce: c=%#010x, expected result 0x00000027 mask 0011\n", c);
puts("END OF TEST");
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//This is a simple test, since the compiler support is not provided
//It is necessary to modify the srec file by hand
int main()
{
int a,b,c;
//test nop
a = 0x01020304;
b = 0x00010203;
//test add
__asm__("ld [%fp + -4], %g2");
__asm__("ld [%fp + -8], %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("sll %g2, %g1, %g1");
__asm__("st %g1, [ %fp + -12 ]");
//add a b
printf("add Awzwz Bxyyx: c=%#010x, expected result 0x04040305 mask 1111\n", c);
puts("END OF TEST");
}
main()
{
report_start();
base_test();
report_end();
}
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment