OpenCores
URL https://opencores.org/ocsvn/tcp_socket/tcp_socket/trunk

Subversion Repositories tcp_socket

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /tcp_socket/trunk/chips2/test_suite
    from Rev 2 to Rev 4
    Reverse comparison

Rev 2 → Rev 4

/.gitignore
2,3 → 2,4
real_main
test
arbiter
test_file
/.coverage
1,29 → 1,29
-coverage v3.4qUlinesq}q(U)/usr/share/pyshared/coverage/collector.pyq]q(KèKéKëKöK÷eUB/media/sdb1/Projects/SP605_DEMO/chips2/chips/compiler/optimizer.pyq]q (KKKKK KKKKKKKKKKKKKKK K"K#K$K&K(K)K*K+K,K-K.K0K1K2K3K4K5K6K8K:K=K>K?K@KAKBKEKFKGKHKKKLKMKNKOKQKSKUKWK[K\K]K_KcKdKeKfKgKiKmKnKpKqKsKtKvKwKyK}K~KK€K‚K†KˆKŒKKK•K–K—K˜K™KšK›KœKKžKŸK K¡K¢K£K¤K¥K§K©KªK«K­K±K²K³K´KµK¶K·K¸K¹KºK»K¼K½K¾K¿KÁKÂKÃKÄKÅKÇeUA/media/sdb1/Projects/SP605_DEMO/chips2/chips/compiler/compiler.pyq -KKKKKKKKKKKK!K#K$K%K)K*K+K,K/K0K1K2K3K4K5K6K7K8K9K:K;KK?KAKBKEKFKGKIKLKMKNKPKSKTKUKWKXK[K\K]K_K`KcKdKeKfKgKjKlKmKpKqKrKsKtKvKyKzK{K}K~KKƒK„K†KˆKŒKŽK’K“K—K›KœKKžKŸK¡K¥K§K¬K­K®K¯K°K±K³eUF/media/sdb1/Projects/SP605_DEMO/chips2/chips/compiler/verilog_speed.pyq]q(KKKKKK KKKKKKKKKK)K.K/K0K1K2K3K5K6K7K:K;KK?KAKBKEKFKGKIKLKMKNKPKSKTKUKWKXK[K\K]K_K`KcKdKeKfKgKjKlKmKpKqKrKsKtKvKyKzK{K}K~KKƒK„K†KˆKŒKŽK’K“K—K›KœKKžKŸK¡K¥K§K¬K­K®K¯K°K±K³eUA/media/sdb1/Projects/Chips-Demo/chips2/chips/compiler/__init__.pyq +(KKKKKK K +KKKKKKKKKKKKKKKK K$K%K&K'K(K)K*K+K-K.K/eUF/media/sdb1/Projects/Chips-Demo/chips2/chips/compiler/verilog_speed.pyq]q(KKKKKK KKKKKKKKKK)K.K/K0K1K2K3K5K6K7K:K;KM?M@MCMEMFMGMHMIMJMLMMMNMOMPMQMRMSMVMWMXMYMZM[M\M]M_M`MaMbMcMdMeMfMiMjMkMlMmMnMoMpMrMsMtMvMwMxMzM{M|M}MM€MMƒM„M†MŠMŽMMM‘M’M“M”M•M—M˜M™M›MœMMžM M¡M¢M£M¤M¥M¦M§M¨MªM«M¬M®M¯M°M±M²MµM¶M¸M¹MºM»M¼M¿MÀMÁMÂMÄMÅMÆMÈMÉMÌMÍMÎMÏMÑMÒMÓMÕMÖMÙMÚMÛMÜMÝMßMàMâMãMäMåMæMèMéMñMòMóMôMõMøMûMýMÿMMMMMMM M -MMMMMMMMMMMMMMMM M!M#M$M%M&M'M,M-M.M/M0M2M4M5M6M8M9M:M;M<M>M?M@MAMCMDMEMFMGMIMJMSMTMUMVMWMXMYMZM[M]M^M_M`MbMcMdMeMfMpMqMsMtMvMwMxMyMzM{M|M}MM€MM‚MƒM„M†M‡MˆMŠMŒMMŽMMM‘M’M“M”M–M—M˜M™MšM›MœMMžMŸM M¡M¢M£M¤M¥M¦M§M¨M©MªM«M¬M­M®M¯M°M±M²M´MµM·M¸MºM»M¼M½M¾M¿MÀMÁMÃMÄMÅMÆMÇMÈMÊMËMÍMÎMÏMÐMÑMÒMÓMÔMÕMÖM×MØMÙMÛMÜMÝMÞMßMàMâMãMäMåMçMèMîMóMôMõMöM÷MøMúMûMýMþMMMM M -M M MMMMMMMMMMMMMMMMM M"M#M$M%M&M'M(M)M*M,M-M.M/M0M1M2M3M4M5M6M7M8M9M:M;M<M=M>M?M@MAMBMCMDMEMGMHMIMJMKMLMMMNMPMQMRMSMTMUMVMXMYMZM[M\M]M^M_MaMcMeMfMgMiMjMkMlMmMoMqMrMsMtMuMvMwMxMzM{M|M}M~MM€M‚MƒM„M…M†M‡MˆM‰MŠM‹MŒMMŽMMM’M”M•M–M—M˜M™M›MœMMŸM eUB/media/sdb1/Projects/SP605_DEMO/chips2/chips/compiler/allocator.pyq]q(KKKKKK K KKKKKKKKKKK K"K&K'K)K+K/K0K1K2K3K4K5K6K7K8K9K:K;KK?K@KBKCKDKEKGKHKJKNKOKPKQKRKSKTKUKVKWKXKYKZK\K]K_K`KbKcKeKfKhKiKkKlKnKoKqKrKtKuKwKxKyK{K|K}K~K€KK‚K„K…K†KˆK‰K‹KŒKKŽKKK’K”K™KšK›KœKKžK K¡K¢K¥K¦K§K©K«K°K±K²K³K´K»K¼KÃKÄKëKìKïKðKñKóKôKöMMMMM M MMMMMMMMMMMMMMM M!M"M$M%M'M(M)M*M+M-M/M1M2M5M6M:M;M<M=M>M@MBMCMDMEMFMHMJMKMMMNMPMQMSMTMUMVMWMXMZM[M_MaMbMcMdMeMfMgMhMiMkMlMmMnMoMqMrMsMtMuMvMwMzM{M~M€MM‚MƒM„M…M†M‡M‰MŠM‹MŒMMM’M“M”M•M–M—M˜M™MšMœMMžMŸM M¡M¢M£M¤M¥M¦M§M¨MªM¹MºM»M¼M¾M¿MÁMÂMÃMÄMÅMÆMÇMÉMÊMËMÌMÍMÎMÏMÑMÓMÔMÕMÖM×MØMÙMÚMÛMÜMÝMÞMßMàMáMâMãMäMåMæMèMéMêMëMìMíMîMïMðMñMóMôMõMöMùMûMüMýMþMÿMMMMMMMM M +MMMMMMMMMMMMMMMM M!M#M$M%M&M'M,M-M.M/M0M2M4M5M6M8M9M:M;M<M>M?M@MAMCMDMEMFMGMIMJMSMTMUMVMWMXMYMZM[M]M^M_M`MbMcMdMeMfMpMqMsMtMvMwMxMyMzM{M|M}MM€MM‚MƒM„M†M‡MˆMŠMŒMMŽMMM‘M’M“M”M–M—M˜M™MšM›MœMMžMŸM M¡M¢M£M¤M¥M¦M§M¨M©MªM«M¬M­M®M¯M°M±M²M´MµM·M¸MºM»M¼M½M¾M¿MÀMÁMÃMÄMÅMÆMÇMÈMÊMËMÍMÎMÏMÐMÑMÒMÓMÔMÕMÖM×MØMÙMÛMÜMÝMÞMßMàMâMãMäMåMçMèMîMóMôMõMöM÷MøMúMûMýMþMMMM M +KKKKKKKKKKKKKK K!K"K#K$K%K&K'K(K)K*K+K,K-K.K/K0K5K6K7K8K9K:K;K>K?K@KAKBKCKDKEKFKGKHKIKJKKKLKNKOKPKQKTeUC/media/sdb1/Projects/Chips-Demo/chips2/chips/compiler/exceptions.pyq"]q#(KKKKKKK K KKKKKKKKKKKKKKKKKK K"K#K$K&K'K)K*K,K-K.K/K2K3K4K6K8K9K:K;KM@MAMBMCMDMEMFMHMIMJMLMMMOMPMQMRMSMTMUMVMWMXMZM[M\M]M^M_M`MaMcMdMeMgMiMjMkMlMmMnMoMpMqMrMsMtMuMwMxMyMzM{M|M}M~MMM‚MƒM„M…M†M‡MˆM‰MŠMŒMMŽMMM‘M’M“M”M•M—M˜M™MšM›MœMMžM M¡M¢M£M¤M¥M§M¨M©MªM«M¬M­M®M°M±M²M³M´MµM¶M·M¹MºM»M¼M¾M¿MÀMÁMÂMÃMÄMÅMÆMÇMÉMÊMËMÌMÎMÐMÑMÒMÔMÕMÖM×MØMÙMÚMÛMÜMÝMÞMßMàMáMâMãMäMåMæMçMèMéMêMëMïMðMñMóMôMõMöM÷MøMùMúMýMÿMMMMMMMMM M MMMMMMMMMMMMMMMM M!M"M#M%M'M(M*M+M,M-M.M0M2M3M5M6M7M8M9M;M<M=M>M?MBMCMDMEMFMGMHMIMJMLMMMNMOMPMQMRMTMUMVMWMXMYMZM[M]M_M`MaMbMcMdMeMfMgMhMiMjMkMlMmMnMoMqMsMtMuMvMwMxMyMzM|M~MM€MM‚M„M…M‡MˆM‰MŠM‹MMM‘M˜M¡M¢M£M¤M¥M§M¨M©MªM«M­M®M¯M°M±M²M´MµM¶M·M¸M¹MºM»M½M¿MÀMÁMÂMÃMÄMÅMÇMÈMÊMËMÍMÎMÏMÐMÑMÒMÓMÔMÕMÖM×MÙMÚMÛMÜMÝMÞMßMãMåMæMçMèMéMêMëMìMïMðMñMòMóMôMõMöM÷MøMùMúMûMüMýMMMMMMMM M -M MMMMMMMMMMMMM M!M"M#M$M%M&M'M(M*M,M-M.M/M0M1M3M4eUA/media/sdb1/Projects/SP605_DEMO/chips2/chips/compiler/builtins.pyq"]q#(KKKKKxeUC/media/sdb1/Projects/SP605_DEMO/chips2/chips/compiler/exceptions.pyq$]q%(KKKKKKK K -K Keuu. \ No newline at end of file +M MMMMMMMMMMMMM M!M"M#M$M%M&M'M(M*M,M-M.M/M0M1M3M4euu. \ No newline at end of file
/test_c2verilog
57,6 → 57,767
else:
print test, "...pass"
 
test("float file 1",
"""
void main(){
file_write(1.0, "test_file");
file_write(-1.0, "test_file");
file_write(2.0, "test_file");
file_write(-2.0, "test_file");
}
"""
)
 
test("float file 2",
"""
void main(){
assert(file_read("test_file") == 1.0);
assert(file_read("test_file") == -1.0);
assert(file_read("test_file") == 2.0);
assert(file_read("test_file") == -2.0);
}
"""
)
 
test_fails("array size1",
"""
int size(){
return 10;
}
void main(){
int blah[size()];
}
"""
)
 
test("array size2",
"""
void main(){
const int b = 10;
int a[b];
}
"""
)
 
test_fails("const 1",
"""
void main(){
const int blah = 10;
blah = 12;
}
"""
)
 
test("const 2",
"""
void main(){
const int blah = 10;
assert(blah == 10);
}
"""
)
 
test_fails("const 3",
"""
void main(){
const float blah = 10;
blah = 12;
}
"""
)
 
test("const 4",
"""
void main(){
const float blah = 10;
assert(blah == 10.0);
}
"""
)
 
test_fails("scope 1",
"""
void test(){
int test_var = 1;
}
 
void main(){
int blah = test_var;
}
"""
)
 
test("inplace float 1",
"""
void main(){
float test = 1.0;
test *= 2.0;
assert(test == 2.0);
test *= 2.0;
assert(test == 4.0);
test *= 2.0;
assert(test == 8.0);
}
"""
)
 
test("inplace float 2",
"""
void main(){
float test = 1.0;
test += 2.0;
assert(test == 3.0);
test += 2.0;
assert(test == 5.0);
test += 2.0;
assert(test == 7.0);
}
"""
)
 
test("inplace float 3",
"""
void main(){
float test = 1.0;
test -= 2.0;
assert(test == -1.0);
test -= 2.0;
assert(test == -3.0);
test -= 2.0;
assert(test == -5.0);
}
"""
)
 
test("inplace float 4",
"""
void main(){
float test = 1.0;
test /= 2.0;
assert(test == 0.5);
test /= 2.0;
assert(test == 0.25);
test /= 2.0;
assert(test == 0.125);
}
"""
)
 
test("inplace float 5",
"""
void main(){
float test = 1.0;
test *= 2;
assert(test == 2.0);
test *= 2;
assert(test == 4.0);
test *= 2;
assert(test == 8.0);
}
"""
)
 
test("inplace float 6",
"""
void main(){
float test = 1.0;
test += 2;
assert(test == 3.0);
test += 2;
assert(test == 5.0);
test += 2;
assert(test == 7.0);
}
"""
)
 
test("inplace float 7",
"""
void main(){
float test = 1.0;
test -= 2;
assert(test == -1.0);
test -= 2;
assert(test == -3.0);
test -= 2;
assert(test == -5.0);
}
"""
)
 
test("inplace float 8",
"""
void main(){
float test = 1.0;
test /= 2;
assert(test == 0.5);
test /= 2;
assert(test == 0.25);
test /= 2;
assert(test == 0.125);
}
"""
)
 
test("float 1",
"""
void main(){
float test = 0.0;
assert(test == 0.0);
}
"""
)
test("float 2",
"""
void main(){
float test = 1.0;
assert(test > 0.0);
}
"""
)
test("float 3",
"""
void main(){
float test = 0.0;
assert(test < 1.0);
}
"""
)
test("float 4",
"""
void main(){
float test = 0.0;
float a = -1.0;
float b = -2.0;
float c = 2.0;
float d = 2.0;
assert(test > -1.0);
assert(a > b);
assert(b < a);
assert(c >= d);
assert(c <= d);
}
"""
)
test("float 5",
"""
void main(){
float test = 0.0;
assert(test == 0.0);
}
"""
)
test("float 6",
"""
void main(){
float blah[10];
blah[0] = 0.0;
blah[1] = 1.0;
blah[2] = 2.0;
blah[3] = 3.0;
assert(blah[0] == 0.0);
assert(blah[1] == 1.0);
assert(blah[2] == 2.0);
assert(blah[3] == 3.0);
}
"""
)
 
test("float 7",
"""
void main(){
float a = 2.0;
assert(a == 1.0 + 1.0);
}
"""
)
 
test("float 8",
"""
void main(){
float a = 2.0;
float b = 2.0;
assert(a+b == 4.0);
}
"""
)
 
test("float 9",
"""
void main(){
float a = -2.0;
float b = -2.0;
assert(a+b == -4.0);
}
"""
)
 
test("float 10",
"""
void main(){
float a = 2.0;
float b = 2.0;
assert(a-b == -0.0);
}
"""
)
 
test("float 11",
"""
void main(){
float a = 2.0;
float b = 4.0;
assert(a-b == -2.0);
}
"""
)
 
test("float 12",
"""
void main(){
float a = 1.0;
float b = 1.0;
assert(a*b == 1.0);
}
"""
)
 
test("float 13",
"""
void main(){
float a = 1.0;
float b = -1.0;
assert(a*b == -1.0);
}
"""
)
 
test("float 14",
"""
void main(){
float a = -1.0;
float b = -1.0;
assert(a*b == 1.0);
}
"""
)
 
test("float 15",
"""
void main(){
float a = -7.0;
float b = 6.0;
assert(a*b == -42.0);
}
"""
)
 
test("float 16",
"""
void main(){
float a = 6.0;
float b = 6.0;
assert(a/b == 1.0);
}
"""
)
 
test("float 17",
"""
void main(){
float a = 12.0;
float b = 6.0;
assert(a/b == 2.0);
}
"""
)
 
test("float 18",
"""
void main(){
int a = 2;
float b = 2.0;
assert(a+b == 4.0);
}
"""
)
 
test("float 19",
"""
void main(){
int a;
float b = 2.0;
a = b + 1.0;
assert(a == 3);
}
"""
)
 
test("float 20",
"""
void main(){
int a = 2;
float b;
b = a + 1.0;
assert(b == 3.0);
}
"""
)
 
test("float 21",
"""
typedef struct {float a; float b;} mystruct;
void main(){
mystruct a;
a.a = 2.0;
a.b = 3.0;
assert(a.a == 2.0);
assert(a.b == 3.0);
assert(a.a + a.b == 5.0);
}
"""
)
test("float 22",
"""
typedef struct {float a; float b;} mystruct;
 
void test(mystruct a){
assert(a.a == 2.0);
assert(a.b == 3.0);
assert(a.a + a.b == 5.0);
}
 
void main(){
mystruct a;
a.a = 2.0;
a.b = 3.0;
test(a);
}
"""
)
 
test("float 23",
"""
void test(float b){
assert(b/6.0 == 2.0);
}
 
void main(){
int a = 12.0;
test(a);
}
"""
)
 
test("float 24",
"""
float test(){
return 6.0;
}
 
void main(){
int a = 12.0;
assert(a/test() == 2.0);
}
"""
)
 
test("float 25",
"""
int main(){
float a = 1.0;
float b = 2.0;
float c = 3.0;
assert(a + b + c == 6.0);
return 0;
}
 
""")
 
test("float 26",
"""
int main(){
float a = 1.0;
float b = 2.0;
float c = 3.0;
assert(a - b - c == -4.0);
return 0;
}
 
""")
 
test("float 27",
"""
int main(){
float a = 1.0;
float b = 2.0;
float c = 3.0;
assert(a - (b - c) == 2.0);
return 0;
}
 
""")
 
test("float 28",
"""
int main(){
float a = 1.0;
float b = 2.0;
float c = 3.0;
assert(a * b * c == 6.0);
return 0;
}
 
""")
 
test("float 29",
"""
int main(){
float a = 1.0;
float b = 2.0;
float c = 4.0;
assert(a/b/c == 0.125);
return 0;
}
 
""")
 
test("float 30",
"""
int main(){
float a = 1.0;
float b = 2.0;
assert(a - - b == 3.0);
return 0;
}
 
""")
 
test("struct_size 1",
"""
 
typedef struct {int a; int b;} mystruct;
 
void main(){
assert(sizeof mystruct == 4);
}
"""
)
 
test("struct_size 2",
"""
 
typedef struct {long int a; int b;} mystruct;
 
void main(){
assert(sizeof mystruct == 6);
}
"""
)
 
test("struct_size 3",
"""
 
typedef struct {long int a; int b;} struct_1;
typedef struct {long int a; struct_1 b;} mystruct;
 
void main(){
assert(sizeof mystruct == 10);
}
"""
)
 
test("struct_size 4",
"""
 
typedef struct {long int a; int b[2];} mystruct;
 
void main(){
assert(sizeof mystruct == 6);
}
"""
)
 
test("struct_passing 1",
"""
 
typedef struct {int a; int b;} mystruct;
 
void test(mystruct mine){
assert(mine.a == 1);
assert(mine.b == 2);
}
 
void main(){
mystruct an;
an.a = 1;
an.b = 2;
test(an);
}
"""
)
 
test("struct_passing 2",
"""
 
typedef struct {long int a; int b;} struct_1;
typedef struct {long int a; struct_1 b;} mystruct;
 
void test(mystruct my){
assert(my.a == 1);
assert(my.b.a == 2);
assert(my.b.b == 3);
}
 
void main(){
mystruct blah;
blah.a = 1;
blah.b.a = 2;
blah.b.b = 3;
test(blah);
}
"""
)
 
test("struct_passing 3",
"""
 
typedef struct {long int a; int b[10];} struct_1;
typedef struct {long int a; struct_1 b;} mystruct;
 
void test(mystruct my){
assert(my.a == 1);
assert(my.b.a == 2);
assert(my.b.b[0] == 3);
}
 
void main(){
mystruct blah;
blah.a = 1;
blah.b.a = 2;
blah.b.b[0] = 3;
test(blah);
}
"""
)
 
#test("struct_return 1",
#"""
#
#typedef struct {long int a; int b;} struct_1;
#
#struct_1 test(){
# struct_1 my;
# my.a = 1;
# my.b = 2;
# return my;
#}
#
#void main(){
# struct_1 blah;
# blah = test();
# assert(blah.a == 1);
# assert(blah.b == 2);
#}
#"""
#)
 
test("print 1",
"""
unsigned test[] = "Hello World!";
unsigned i=0;
void stdout_put_char(unsigned value){
assert(test[i] == value);
i++;
}
#include <print.h>
 
void main(){
print_string("Hello World!");
}
"""
)
 
test("print 2",
"""
unsigned test[] = "12345";
unsigned i=0;
void stdout_put_char(unsigned value){
assert(test[i] == value);
i++;
}
#include <print.h>
 
void main(){
print_decimal(12345);
}
"""
)
 
test("print 3",
"""
unsigned test[] = "-1234";
unsigned i=0;
void stdout_put_char(unsigned value){
assert(test[i] == value);
i++;
}
#include <print.h>
 
void main(){
print_decimal(-1234);
}
"""
)
 
test("print 4",
"""
unsigned test[] = "-1";
unsigned i=0;
void stdout_put_char(unsigned value){
assert(test[i] == value);
i++;
}
#include <print.h>
 
void main(){
print_decimal(-1);
}
"""
)
 
test("print 5",
"""
unsigned test[] = "7fff";
unsigned i=0;
void stdout_put_char(unsigned value){
assert(test[i] == value);
i++;
}
#include <print.h>
 
void main(){
print_hex(0x7fff);
}
"""
)
 
test("print 6",
"""
unsigned test[] = "ffff";
unsigned i=0;
void stdout_put_char(unsigned value){
assert(test[i] == value);
i++;
}
#include <print.h>
 
void main(){
print_uhex(0xffffu);
}
"""
)
 
test("unsigned divide 1",
"""
void main(){
2823,6 → 3584,29
return 0;
}
""")
 
test_fails("error 12",
"""
 
typedef struct {long int a; int b;} struct_1;
typedef struct {long int a; struct_1 b;} mystruct;
 
void test(mystruct my){
assert(mystruct.a == 1);
assert(mystruct.b.a == 2);
assert(mystruct.b.b == 3);
}
 
void main(){
mystruct blah;
blah.a = 1;
blah.b.a = 2;
blah.b.b = 3;
test(blah);
}
"""
)
 
test("input 1",
"""
int main(){
2880,8 → 3664,8
}
""")
 
os.system("python-coverage run -p c2verilog.py")
os.system("python-coverage run -p ../c2verilog")
os.system("python-coverage combine")
os.system("python-coverage report")
os.system("python-coverage annotate c2verilog.py")
os.system("python-coverage annotate compiler/parser.py")
os.system("python-coverage annotate ../c2verilog")
os.system("python-coverage annotate ../chips/compiler/parser.py")

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.