URL
https://opencores.org/ocsvn/sc2v/sc2v/trunk
Subversion Repositories sc2v
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 26 to Rev 27
- ↔ Reverse comparison
Rev 26 → Rev 27
/trunk/ChangeLog
1,3 → 1,9
18-05-2005 Version 0.4.3 |
|
Corrected bug using ? and _ in header file |
Corrected bug using multiple pointer declarations in header file |
Added #ifndef to implementation file |
|
18-03-2005 Version 0.4.2 |
|
Corrected bug in hexadecimal numbers in case statatements |
/trunk/src/sc2v_step1.y
127,7 → 127,7
%token COLON SEMICOLON RANGE OPENPAR CLOSEPAR TWODOUBLEPOINTS OPENCORCH CLOSECORCH SWITCH CASE DEFAULT BREAK |
%token HEXA DEFINE READ TRANSLATEOFF TRANSLATEON VERILOGBEGIN VERILOGEND TAB DOLLAR MINEQ |
%token VOID TTRUE TFALSE ENDFUNC INC DEC INTEGER EQUALS |
%token PIFDEF PENDDEF PELSE |
%token PIFDEF PIFNDEF PENDDEF PELSE |
|
%% commands: /* empty */ |
|commands command; |
221,6 → 221,8
verilogend |
| |
ifdef |
| |
ifndef |
| |
endif |
| |
1284,6 → 1286,26
fprintf (file, "#ifdef"); |
}; |
|
ifndef: |
PIFNDEF |
{ |
defineparenthesis = 0; |
if (translate == 1 && verilog == 0) |
{ |
if (processfound) |
{ |
ifdeffound = 1; |
fprintf (file, "`ifndef"); |
} |
else if (definefound) |
{ |
fprintf (FILE_DEFINES, "`ifndef"); |
} |
} |
else if (verilog == 1) |
fprintf (file, "#ifndef"); |
}; |
|
endif: |
PENDDEF |
{ |
/trunk/src/sc2v_step2.y
202,6 → 202,12
| |
inst_decl |
| |
multiple_inst_decl |
| |
multiple_inst_decl_cont |
| |
multiple_inst_decl_end |
| |
closekey_semicolon |
| |
enumerates |
677,10 → 683,10
}; |
|
|
void:VOID WORD OPENPAR CLOSEPAR SEMICOLON |
void: |
VOID WORD OPENPAR CLOSEPAR SEMICOLON |
{ |
|
|
}; |
|
|
687,13 → 693,30
inst_decl: |
WORD ASTERISCO WORD SEMICOLON |
{ |
/*Ignore*/ |
|
}; |
multiple_inst_decl: |
WORD ASTERISCO WORD COLON |
{ |
/*Ignore*/ |
|
}; |
multiple_inst_decl_cont: |
ASTERISCO WORD COLON |
{ |
/*Ignore*/ |
|
}; |
multiple_inst_decl_end: |
ASTERISCO WORD SEMICOLON |
{ |
/*Ignore*/ |
|
}; |
|
closekey_semicolon:CLOSEKEY SEMICOLON |
closekey_semicolon: |
CLOSEKEY SEMICOLON |
{ |
|
|
/trunk/src/sc2v_step1.l
85,6 → 85,7
"#define" if(!includefound & !linecomment & !multilinecomment) return DEFINE; else {yylval=(int)strdup(yytext);} return WORD; |
"#include" includefound = 1; |
"#ifdef" if(!includefound & !linecomment & !multilinecomment) return PIFDEF; else {yylval=(int)strdup(yytext);} return WORD; |
"#ifndef" if(!includefound & !linecomment & !multilinecomment) return PIFNDEF; else {yylval=(int)strdup(yytext);} return WORD; |
"#else" if(!includefound & !linecomment & !multilinecomment) return PELSE; else {yylval=(int)strdup(yytext);} return WORD; |
"#endif" if(!includefound & !linecomment & !multilinecomment) return PENDDEF; else {yylval=(int)strdup(yytext);} return WORD; |
"//" if (!multilinecomment) linecomment = 1; yylval=(int)strdup(yytext); return WORD; |
/trunk/src/sc2v_step2.l
101,6 → 101,9
"@" |
"|" |
"~" |
"_" |
"?" |
|
|
"("[ ]*"sc_uint"[ ]*"<"[ ]*[0-9]+[ ]*">"[ ]*")" |
"("[ ]*"sc_biguint"[ ]*"<"[ ]*[0-9]+[ ]*">"[ ]*")" |
/trunk/Makefile
18,7 → 18,7
|
test: |
cd src; make all |
cd examples; ../bin/sc2v.sh delay_line; ../bin/sc2v.sh stmach_k; ../bin/sc2v.sh rng; ../bin/sc2v.sh md5; ../bin/sc2v.sh dummy1 ; ../bin/sc2v.sh dummy2; echo ""; echo "sc2v translated the following files successfully"; echo ""; ls -l *.v |
cd examples; ../bin/sc2v.sh dummy1; ../bin/sc2v.sh dummy2 ;../bin/sc2v.sh delay_line; ../bin/sc2v.sh stmach_k;../bin/sc2v.sh rng; ../bin/sc2v.sh md5; ../bin/sc2v.sh half_adder; ../bin/sc2v.sh full_adder; echo ""; echo "sc2v translated the following files successfully"; echo ""; ls -l *.v |
|
docs: |
cd src; doxygen doxygen.cfg |
/trunk/examples/full_adder.cpp
0,0 → 1,7
// File: full_adder.cpp |
|
#include "full_adder.h" |
|
void full_adder::prc_or () { |
carry_out.write(c1 | c2); |
} |
trunk/examples/full_adder.cpp
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/examples/full_adder.h
===================================================================
--- trunk/examples/full_adder.h (nonexistent)
+++ trunk/examples/full_adder.h (revision 27)
@@ -0,0 +1,45 @@
+// File: full_adder.h
+
+#include "half_adder.h"
+
+SC_MODULE (full_adder) {
+ sc_in a, b, carry_in;
+
+ sc_out sum, carry_out;
+
+ sc_signal c1, s1, c2;
+
+ void prc_or ();
+
+ half_adder *ha1_ptr, *ha2_ptr,*ha2_ptr; // not supported by sc2v_0.4 ?
+
+ SC_CTOR (full_adder) {
+ ha1_ptr = new half_adder ("ha1");
+
+ // Named association:
+ ha1_ptr->a (a);
+ ha1_ptr->b (b);
+ ha1_ptr->sum (s1);
+ ha1_ptr->carry (c1);
+
+ ha2_ptr = new half_adder ("ha2");
+
+ // Positional association:
+// (*ha2_ptr) (s1, carry_in, sum, c2); // not supported by scv_0.4 ?
+ ha2_ptr->a (s1);
+ ha2_ptr->b (carry_in);
+ ha2_ptr->sum (sum);
+ ha2_ptr->carry (c2);
+
+
+ SC_METHOD (prc_or);
+ sensitive << c1 << c2;
+ }
+//#ifndef SYNTHESIS
+// Destructors not supported by sc2v _0.4 ?
+//~full_adder() {
+// delete ha1_ptr;
+// delete ha2_ptr;
+//}
+//#endif
+};
trunk/examples/full_adder.h
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/examples/half_adder.cpp
===================================================================
--- trunk/examples/half_adder.cpp (nonexistent)
+++ trunk/examples/half_adder.cpp (revision 27)
@@ -0,0 +1,9 @@
+// File: half_adder.cpp // Line 1
+#include "half_adder.h" // Line 2
+
+void half_adder::prc_half_adder () { // Line 3
+// sum = a ^ b; // Line 4a
+ sum.write(a ^ b); // Line 4
+// carry = a & b; // Line 5a
+ carry.write(a & b); // Line 5
+}
trunk/examples/half_adder.cpp
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/examples/half_adder.h
===================================================================
--- trunk/examples/half_adder.h (nonexistent)
+++ trunk/examples/half_adder.h (revision 27)
@@ -0,0 +1,16 @@
+// File: half_adder.h /* Line 1 */
+
+#include "systemc.h" /* Line 2 */
+
+SC_MODULE (half_adder) { /* Line 3 */
+ sc_in a, b; /* Line 4 */
+
+ sc_out sum, carry; /* Line 5 */
+
+ void prc_half_adder (); /* Line 6 */
+
+ SC_CTOR (half_adder) { /* Line 7 */
+ SC_METHOD (prc_half_adder); /* Line 8 */
+ sensitive << a << b; /* Line 9 */
+ } /* Line 10 */
+}; /* Line 11 */
trunk/examples/half_adder.h
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property