Skip to content

Commit

Permalink
Merge pull request chipsalliance#3763 from alainmarcel/alainmarcel-pa…
Browse files Browse the repository at this point in the history
…tch-1

temp disabling GC typespec due to valgrind errors
  • Loading branch information
alaindargelas authored Jul 17, 2023
2 parents 472437d + 363f2d9 commit a991c17
Show file tree
Hide file tree
Showing 82 changed files with 202 additions and 166 deletions.
8 changes: 4 additions & 4 deletions src/DesignCompile/CompileStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ bool CompileHelper::compileTask(DesignComponent* component,
stmts->push_back(st);
} else {
any_cast<variables*>((expr*)stmt->Lhs())->VpiParent(begin);
s.Erase(stmt);
// s.Erase(stmt);
}
} else {
stmts->push_back(st);
Expand Down Expand Up @@ -2036,7 +2036,7 @@ bool CompileHelper::compileTask(DesignComponent* component,
task->Stmt(st);
} else {
any_cast<variables*>((expr*)stmt->Lhs())->VpiParent(task);
s.Erase(stmt);
// s.Erase(stmt);
}
} else {
task->Stmt(st);
Expand Down Expand Up @@ -2405,7 +2405,7 @@ bool CompileHelper::compileFunction(DesignComponent* component,
stmts->push_back(st);
} else {
any_cast<variables*>((expr*)stmt->Lhs())->VpiParent(begin);
s.Erase(stmt);
// s.Erase(stmt);
}
} else {
stmts->push_back(st);
Expand Down Expand Up @@ -2451,7 +2451,7 @@ bool CompileHelper::compileFunction(DesignComponent* component,
func->Stmt(st);
} else {
any_cast<variables*>((expr*)stmt->Lhs())->VpiParent(func);
s.Erase(stmt);
// s.Erase(stmt);
}
} else {
func->Stmt(st);
Expand Down
32 changes: 16 additions & 16 deletions src/DesignCompile/ElaborationStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ void ElaborationStep::swapTypespecPointers(
// Replace all references of obsolete typespecs
for (auto o : s.AllObjects()) {
any* var = (any*)o.first;
std::vector<const typespec*> all_orig;
if (expr* ex = any_cast<expr*>(var)) {
ex->Typespec(replace(ex->Typespec(), typespecSwapMap));
} else if (typespec_member* ex = any_cast<typespec_member*>(var)) {
Expand All @@ -417,33 +416,34 @@ void ElaborationStep::swapTypespecPointers(
(class_typespec*)replace(ex->Class_typespec(), typespecSwapMap));
} else if (class_defn* ex = any_cast<class_defn*>(var)) {
if (ex->Typespecs()) {
for (UHDM::VectorOftypespec::iterator itr = ex->Typespecs()->begin();
itr != ex->Typespecs()->end(); itr++) {
(*itr) = replace(*itr, typespecSwapMap);
for (uint32_t i = 0; i < ex->Typespecs()->size(); i++) {
ex->Typespecs()->at(i) =
replace(ex->Typespecs()->at(i), typespecSwapMap);
}
}
} else if (ports* ex = any_cast<ports*>(var)) {
ex->Typespec(replace(ex->Typespec(), typespecSwapMap));
} else if (class_obj* ex = any_cast<class_obj*>(var)) {
if (ex->Typespecs()) {
for (UHDM::VectorOftypespec::iterator itr = ex->Typespecs()->begin();
itr != ex->Typespecs()->end(); itr++) {
(*itr) = replace(*itr, typespecSwapMap);
for (uint32_t i = 0; i < ex->Typespecs()->size(); i++) {
ex->Typespecs()->at(i) =
replace(ex->Typespecs()->at(i), typespecSwapMap);
}
}
ex->Class_typespec(
(class_typespec*)replace(ex->Class_typespec(), typespecSwapMap));
} else if (scope* ex = any_cast<scope*>(var)) {
if (ex->Typespecs()) {
for (auto ori : *ex->Typespecs()) {
all_orig.push_back(ori);
for (uint32_t i = 0; i < ex->Typespecs()->size(); i++) {
ex->Typespecs()->at(i) =
replace(ex->Typespecs()->at(i), typespecSwapMap);
}
}
} else if (design* ex = any_cast<design*>(var)) {
if (ex->Typespecs()) {
for (UHDM::VectorOftypespec::iterator itr = ex->Typespecs()->begin();
itr != ex->Typespecs()->end(); itr++) {
(*itr) = replace(*itr, typespecSwapMap);
for (uint32_t i = 0; i < ex->Typespecs()->size(); i++) {
ex->Typespecs()->at(i) =
replace(ex->Typespecs()->at(i), typespecSwapMap);
}
}
} else if (extends* ex = any_cast<extends*>(var)) {
Expand Down Expand Up @@ -478,10 +478,10 @@ void ElaborationStep::swapTypespecPointers(
}
}
// Purge obsolete typespecs
for (auto o : typespecSwapMap) {
const typespec* orig = o.first;
s.Erase(orig);
}
// for (auto o : typespecSwapMap) {
// const typespec* orig = o.first;
// s.Erase(orig);
//}
}

bool ElaborationStep::bindTypedefsPostElab_() {
Expand Down
8 changes: 4 additions & 4 deletions tests/ArianeElab/ArianeElab.log
Original file line number Diff line number Diff line change
Expand Up @@ -20218,7 +20218,7 @@ AST_DEBUG_END
[INF:UH0706] Creating UHDM Model...

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
assign_stmt 49
assign_stmt 73
assignment 66
begin 83
bit_select 103
Expand Down Expand Up @@ -20276,13 +20276,13 @@ tagged_pattern 924
type_parameter 2
typespec_member 1146
union_typespec 4
unsupported_typespec 25
unsupported_typespec 31
var_select 48
=== UHDM Object Stats End ===
[INF:UH0707] Elaborating UHDM...

=== UHDM Object Stats Begin (Elaborated Model) ===
assign_stmt 122
assign_stmt 146
assignment 202
begin 265
bit_select 295
Expand Down Expand Up @@ -20340,7 +20340,7 @@ tagged_pattern 924
type_parameter 2
typespec_member 1146
union_typespec 4
unsupported_typespec 25
unsupported_typespec 31
var_select 216
=== UHDM Object Stats End ===
[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/ArianeElab/slpp_all/surelog.uhdm ...
Expand Down
8 changes: 4 additions & 4 deletions tests/ArianeElab2/ArianeElab2.log
Original file line number Diff line number Diff line change
Expand Up @@ -20833,7 +20833,7 @@ AST_DEBUG_END
[INF:UH0706] Creating UHDM Model...

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
assign_stmt 51
assign_stmt 75
assignment 66
begin 83
bit_select 390
Expand Down Expand Up @@ -20890,12 +20890,12 @@ tagged_pattern 29584
type_parameter 7
typespec_member 13570
union_typespec 4
unsupported_typespec 26
unsupported_typespec 32
=== UHDM Object Stats End ===
[INF:UH0707] Elaborating UHDM...

=== UHDM Object Stats Begin (Elaborated Model) ===
assign_stmt 124
assign_stmt 148
assignment 202
begin 265
bit_select 1859
Expand Down Expand Up @@ -20952,7 +20952,7 @@ tagged_pattern 29584
type_parameter 7
typespec_member 13570
union_typespec 4
unsupported_typespec 26
unsupported_typespec 32
=== UHDM Object Stats End ===
[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/ArianeElab2/slpp_all/surelog.uhdm ...

Expand Down
2 changes: 2 additions & 0 deletions tests/ArrayMethodIterator/ArrayMethodIterator.log
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ AST_DEBUG_END
=== UHDM Object Stats Begin (Non-Elaborated Model) ===
array_typespec 2
array_var 2
assign_stmt 3
assignment 1
begin 1
class_defn 3
Expand All @@ -208,6 +209,7 @@ type_parameter 2
=== UHDM Object Stats Begin (Elaborated Model) ===
array_typespec 2
array_var 6
assign_stmt 3
assignment 2
begin 2
class_defn 3
Expand Down
2 changes: 2 additions & 0 deletions tests/BindMethod/BindMethod.log
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ AST_DEBUG_END
[INF:UH0706] Creating UHDM Model...

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
assign_stmt 2
assignment 2
begin 2
class_defn 4
Expand All @@ -139,6 +140,7 @@ task 3
[INF:UH0707] Elaborating UHDM...

=== UHDM Object Stats Begin (Elaborated Model) ===
assign_stmt 2
assignment 4
begin 4
class_defn 4
Expand Down
4 changes: 2 additions & 2 deletions tests/Bindings/Bindings.log
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ ref_obj 69
string_typespec 3
sys_func_call 3
task 9
unsupported_typespec 5
unsupported_typespec 7
=== UHDM Object Stats End ===
[INF:UH0707] Elaborating UHDM...

Expand Down Expand Up @@ -1436,7 +1436,7 @@ ref_obj 97
string_typespec 3
sys_func_call 3
task 18
unsupported_typespec 5
unsupported_typespec 7
=== UHDM Object Stats End ===
[ERR:UH0718] ${SURELOG_DIR}/tests/Bindings/dut.sv:75:11: Illegal lhs of type wire "data_r".

Expand Down
2 changes: 2 additions & 0 deletions tests/BlackBePipeInt/BlackBePipeInt.log
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ sys_func_call 25
tagged_pattern 55611
typespec_member 96306
union_typespec 6
unsupported_typespec 1
=== UHDM Object Stats End ===
[INF:UH0707] Elaborating UHDM...

Expand Down Expand Up @@ -107,6 +108,7 @@ sys_func_call 31
tagged_pattern 55611
typespec_member 96306
union_typespec 6
unsupported_typespec 1
=== UHDM Object Stats End ===
[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/BlackBePipeInt/slpp_all/surelog.uhdm ...

Expand Down
4 changes: 2 additions & 2 deletions tests/BlackParrotMuteErrors/BlackParrotMuteErrors.log
Original file line number Diff line number Diff line change
Expand Up @@ -6643,7 +6643,7 @@ AST_DEBUG_END

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
array_typespec 77
assign_stmt 3
assign_stmt 5
assignment 6
begin 4
bit_select 24
Expand Down Expand Up @@ -6697,7 +6697,7 @@ unsupported_typespec 378

=== UHDM Object Stats Begin (Elaborated Model) ===
array_typespec 77
assign_stmt 5
assign_stmt 7
assignment 12
begin 8
bit_select 28
Expand Down
6 changes: 4 additions & 2 deletions tests/ClassFuncProto/ClassFuncProto.log
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ Instance tree:
[INF:UH0706] Creating UHDM Model...

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
assign_stmt 1
bit_typespec 1
class_defn 13
class_typespec 7
Expand All @@ -530,11 +531,12 @@ package 2
range 3
ref_var 2
task 10
unsupported_typespec 5
unsupported_typespec 6
=== UHDM Object Stats End ===
[INF:UH0707] Elaborating UHDM...

=== UHDM Object Stats Begin (Elaborated Model) ===
assign_stmt 1
bit_typespec 7
class_defn 16
class_typespec 20
Expand All @@ -556,7 +558,7 @@ package 2
range 23
ref_var 16
task 26
unsupported_typespec 5
unsupported_typespec 6
=== UHDM Object Stats End ===
[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/ClassFuncProto/slpp_all/surelog.uhdm ...

Expand Down
8 changes: 4 additions & 4 deletions tests/ClassMemberFunc/ClassMemberFunc.log
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ AST_DEBUG_END
[INF:UH0706] Creating UHDM Model...

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
assign_stmt 2
assign_stmt 4
begin 2
class_defn 2
class_typespec 1
Expand All @@ -116,12 +116,12 @@ method_func_call 2
package 2
ref_obj 4
ref_var 2
unsupported_typespec 4
unsupported_typespec 6
=== UHDM Object Stats End ===
[INF:UH0707] Elaborating UHDM...

=== UHDM Object Stats Begin (Elaborated Model) ===
assign_stmt 4
assign_stmt 6
begin 4
class_defn 2
class_typespec 2
Expand All @@ -133,7 +133,7 @@ method_func_call 4
package 2
ref_obj 8
ref_var 8
unsupported_typespec 4
unsupported_typespec 6
=== UHDM Object Stats End ===
[INF:UH0708] Writing UHDM DB: ${SURELOG_DIR}/build/regression/ClassMemberFunc/slpp_all/surelog.uhdm ...

Expand Down
4 changes: 2 additions & 2 deletions tests/ClassVar/ClassVar.log
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ AST_DEBUG_END
=== UHDM Object Stats Begin (Non-Elaborated Model) ===
array_typespec 2
array_var 2
assign_stmt 2
assign_stmt 3
begin 2
bit_select 2
class_defn 2
Expand All @@ -177,7 +177,7 @@ unsupported_typespec 2
=== UHDM Object Stats Begin (Elaborated Model) ===
array_typespec 2
array_var 5
assign_stmt 4
assign_stmt 5
begin 4
bit_select 4
class_defn 2
Expand Down
8 changes: 4 additions & 4 deletions tests/DollarRoot/DollarRoot.log
Original file line number Diff line number Diff line change
Expand Up @@ -6758,7 +6758,7 @@ AST_DEBUG_END
always 9
array_typespec 10
array_var 5
assign_stmt 32
assign_stmt 53
assignment 65
begin 84
bit_select 42
Expand Down Expand Up @@ -6813,7 +6813,7 @@ sys_func_call 19
task 21
task_call 22
typespec_member 10
unsupported_typespec 9
unsupported_typespec 11
var_select 2
wait_stmt 1
=== UHDM Object Stats End ===
Expand All @@ -6823,7 +6823,7 @@ wait_stmt 1
always 18
array_typespec 10
array_var 5
assign_stmt 50
assign_stmt 71
assignment 130
begin 168
bit_select 84
Expand Down Expand Up @@ -6878,7 +6878,7 @@ sys_func_call 38
task 42
task_call 44
typespec_member 10
unsupported_typespec 9
unsupported_typespec 11
var_select 4
wait_stmt 2
=== UHDM Object Stats End ===
Expand Down
4 changes: 2 additions & 2 deletions tests/EvalFunc/EvalFunc.log
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ AST_DEBUG_END
[INF:UH0706] Creating UHDM Model...

=== UHDM Object Stats Begin (Non-Elaborated Model) ===
assign_stmt 3
assign_stmt 5
assignment 15
begin 8
constant 104
Expand Down Expand Up @@ -778,7 +778,7 @@ sys_func_call 1
[INF:UH0707] Elaborating UHDM...

=== UHDM Object Stats Begin (Elaborated Model) ===
assign_stmt 6
assign_stmt 8
assignment 30
begin 16
constant 104
Expand Down
Loading

0 comments on commit a991c17

Please sign in to comment.