Skip to content

Commit c5b8c17

Browse files
Version 1.3.8
1 parent e795f23 commit c5b8c17

File tree

823 files changed

+14779
-11347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

823 files changed

+14779
-11347
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ install(FILES ${PROJECT_BINARY_DIR}/SVCConfig.cmake cmake/svc_target.cmake
9595
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SVC)
9696

9797
# Install sctMemory
98-
install(DIRECTORY components/memory/sctmemory DESTINATION include)
98+
#install(DIRECTORY components/memory/sctmemory DESTINATION include)
9999

100100
# Install sctCommon
101101
install(DIRECTORY components/common/sctcommon DESTINATION include)

components/memory/sctmemory/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

sc_tool/lib/sc_tool/SCToolFrontendAction.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,33 +115,28 @@ Object* getOuterArray(SCDesign& designDB, Object* memberObj)
115115
void SCElabASTConsumer::HandleTranslationUnit(clang::ASTContext &astCtx)
116116
{
117117
std::cout << "--------------------------------------------------------------" << std::endl;
118-
std::cout << " Intel Compiler for SystemC (ICSC) version 1.3.7, 23 Oct 2020" << std::endl;
118+
std::cout << " Intel Compiler for SystemC (ICSC) version 1.3.8, 06 Nov 2020" << std::endl;
119119
std::cout << "--------------------------------------------------------------" << std::endl;
120120

121121
ENABLE_REMOVE_EXTRA_CODE = noRemoveExtraCode ? 0 : 0xFFFFFFFF;
122122

123123
using namespace std;
124124
using namespace DebugOptions;
125-
//const char* optNames[] = {doModuleBuilder, doUseDef, doConstStmt, doConstFuncCall};
126-
//const char* optNames[] = {doModuleBuilder, doGenStmt, doGenFuncCall, doGenRTL};
127-
//const char* optNames[] = {doModuleBuilder, doConstCfg, doConstStmt, doConstFuncCall};
128-
//const char* optNames[] = {doModuleBuilder, doGenCfg, doGenStmt, doGenFuncCall, doGenRTL};
129-
//const char* optNames[] = {doModuleBuilder, doGenCfg, doGenStmt, doGenFuncCall, doGenRTL};
130-
//const char* optNames[] = {doConstStmt, doState};
131125
//const char* optNames[] = {doElab};
126+
//const char* optNames[] = {doConstCfg, doGenCfg};
132127
//const char* optNames[] = {doModuleBuilder, doGenCfg, doGenTerm, doGenRTL, doGenStmt, doGenBlock};
133128
//const char* optNames[] = {doModuleBuilder, doGenCfg, doGenStmt, doGenFuncCall, doVerWriter};
134129
//const char* optNames[] = {doModuleBuilder, doGenStmt, doGenName, doGenRTL};
135130
//const char* optNames[] = {doModuleBuilder, doConstCfg, doConstTerm, doConstBlock, doGenCfg};
136131
//const char* optNames[] = {doConstStmt};
137-
//const char* optNames[] = {doConstCfg, doConstBlock, doModuleBuilder};
132+
//const char* optNames[] = {doConstCfg, doElab};
138133
//const char* optNames[] = {doGenCfg, doGenLoop, doGenBlock, doModuleBuilder};
139-
//const char* optNames[] = {doModuleBuilder, doGenCfg, doGenStmt, doGenRTL};
140-
const char* optNames[] = {doModuleBuilder, doGenStmt, doGenRTL};
134+
//const char* optNames[] = {doModuleBuilder, doConstCfg, doConstStmt, doState};
135+
const char* optNames[] = {doModuleBuilder, doGenStmt};
141136
//const char* optNames[] = {doModuleBuilder};
142137
size_t optSize = sizeof(optNames)/sizeof(const char*);
143138
//DebugOptions::enable(optNames, optSize);
144-
139+
145140
//keepConstVariables = true;
146141

147142
// Find pointer to top-level module by SystemC name

sc_tool/lib/sc_tool/cfg/ScTraverseProc.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,9 +2191,12 @@ void ScTraverseProc::printFunctionBody(std::ostream &os)
21912191
} else {
21922192
topGraph = scopeGraph;
21932193
}
2194-
//cout << "Top function scopeGraph #" << hex << topGraph.get() << dec << endl;
2194+
topGraph->putNotReplacedVars(codeWriter->getNotReplacedVars());
2195+
topGraph->putVarAssignStmts(codeWriter->getVarAssignStmts());
21952196

2196-
topGraph->printAllScopes(os);
2197+
//cout << "--------------------------------------------" << endl;
2198+
//cout << "Top function scopeGraph #" << hex << topGraph.get() << dec << endl;
2199+
topGraph->printAllScopes(os);
21972200
}
21982201

21992202
// Print temporal assertion in thread process, printed in @always_ff

sc_tool/lib/sc_tool/diag/ScToolDiagnostic.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ class ScDiag {
160160
SYNTH_CPP_COMMA = 188,
161161
CPP_COMMA_SIMPLE_LHS = 189,
162162
SC_CONCAT_INT_TO_BOOL = 190,
163+
SC_BIT_WRONG_INDEX = 191,
164+
SC_BIT_WRONG_BASE = 192,
165+
CPP_NONSTD_TYPE_WIDTH = 193,
163166

164167
SC_FATAL_ELAB_TYPES_NS = 200,
165168
SC_WARN_ELAB_UNSUPPORTED_TYPE,
@@ -239,30 +242,41 @@ class ScDiag {
239242
idFormatMap[SYNTH_ZERO_TYPE_WIDTH] =
240243
{clang::DiagnosticIDs::Fatal,
241244
"Zero type width not allowed for variable : %0"};
245+
idFormatMap[CPP_NONSTD_TYPE_WIDTH] =
246+
{clang::DiagnosticIDs::Warning,
247+
"C++ type width differs from SC synth standard requirements : %0"};
248+
242249

243250
idFormatMap[SYNTH_WIDTH_WIDENNING] =
244251
{clang::DiagnosticIDs::Remark,
245252
"Widening width in type cast : %0 to %1"};
246253

247254
idFormatMap[SC_RANGE_DIFF_VARS] =
248255
{clang::DiagnosticIDs::Fatal,
249-
"Incorrect range, different variables in lo/hi"};
256+
"Incorrect range access, different variables in lo/hi"};
250257
idFormatMap[SC_RANGE_WRONG_INDEX] =
251258
{clang::DiagnosticIDs::Fatal,
252-
"Incorrect range, low index bigger than high or negative one"};
259+
"Incorrect range access, low index bigger than high or negative one"};
253260
idFormatMap[SC_RANGE_WRONG_WIDTH] =
254261
{clang::DiagnosticIDs::Fatal,
255-
"Incorrect range, high index out of variable width"};
262+
"Incorrect range access, high index out of variable width"};
256263
idFormatMap[SC_RANGE_WRONG_BASE] =
257264
{clang::DiagnosticIDs::Error,
258-
"Incorrect range, base cannot be expression or literal"};
265+
"Incorrect range access, base cannot be expression or literal"};
259266
idFormatMap[SYNTH_SWITCH_LAST_EMPTY_CASE] =
260267
{clang::DiagnosticIDs::Fatal,
261268
"Incorrect switch statement, no break in last case"};
262269
idFormatMap[SYNTH_SWITCH_ALL_EMPTY_CASE] =
263270
{clang::DiagnosticIDs::Fatal,
264271
"Incorrect switch statement, all cases are empty"};
265272

273+
idFormatMap[SC_BIT_WRONG_INDEX] =
274+
{clang::DiagnosticIDs::Fatal,
275+
"Incorrect bit access, index out of variable width"};
276+
idFormatMap[SC_BIT_WRONG_BASE] =
277+
{clang::DiagnosticIDs::Error,
278+
"Incorrect bit access, base cannot be expression or literal"};
279+
266280
idFormatMap[CPP_FOR_WITHOUT_INIT] =
267281
{clang::DiagnosticIDs::Warning,
268282
"For loop without counter initialization"};

sc_tool/lib/sc_tool/dyn_elab/DesignDbGenerator.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ void DesignDbGenerator::addChildrenRecursive(TypedObject hostTO, Object* hostEO)
330330

331331
bool isConstArray = hostTO.getType().isConstQualified() ||
332332
hostEO->is_constant();
333-
bool intArray = isAnyInteger(arrayObj->getInnerElementType());
333+
bool intArray = arrayObj->size() != 0 &&
334+
isAnyInteger(arrayObj->getInnerElementType());
334335

335336
// For efficiency, array elements for non-const integer arrays are not created
336337
// TODO: support small array here
@@ -351,9 +352,11 @@ void DesignDbGenerator::addChildrenRecursive(TypedObject hostTO, Object* hostEO)
351352

352353
} else {
353354
// Create dummy primitive inside array to hold bitwidth
354-
auto intObj = arrayObj->getFirstInnerElement().getAs<IntegerObject>();
355-
hostEO->mutable_primitive()->set_kind(Primitive::VALUE);
356-
fillIntValue(hostEO, *intObj);
355+
if (arrayObj->size() != 0) {
356+
auto intObj = arrayObj->getFirstInnerElement().getAs<IntegerObject>();
357+
hostEO->mutable_primitive()->set_kind(Primitive::VALUE);
358+
fillIntValue(hostEO, *intObj);
359+
}
357360
}
358361
}
359362

sc_tool/lib/sc_tool/dyn_elab/Reflection.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,15 @@ clang::QualType ArrayObject::getElementType() const
503503

504504
clang::QualType ArrayObject::getInnerElementType() const
505505
{
506+
assert (size() != 0 && "Zero-size array/vector getInnerElementType()");
506507
return getFirstInnerElement().getType();
507508
}
508509

509-
TypedObject ArrayObject::getFirstInnerElement() const {
510+
TypedObject ArrayObject::getFirstInnerElement() const
511+
{
512+
assert (size() != 0 && "Zero-size array/vector getFirstInnerElement()");
510513
TypedObject element = (*this)[0];
514+
511515
while (element.isArrayObject()) {
512516
element = element.getAs<ArrayObject>()->operator[](0);
513517
}

0 commit comments

Comments
 (0)