Skip to content

Commit

Permalink
Fix arch-content and tree node extensions final config YAML bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
colby-nyce authored and klingaard committed Nov 11, 2024
1 parent 9cb50ce commit 05ba853
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
35 changes: 18 additions & 17 deletions sparta/sparta/parsers/ConfigEmitterYAML.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class YAML : public ConfigEmitter
{
sparta_assert(emitter_ == nullptr);
sparta_assert(device_tree);
sparta_assert(extensions_ptree);

if(verbose){
std::cout << "Writing parameters to \"" << filename_ << "\"" << std::endl;
Expand All @@ -108,22 +107,24 @@ class YAML : public ConfigEmitter

handleNode_(device_tree, verbose);

// Note we use the ParameterTree to get the tree node extensions instead
// of the device tree since using the device tree might serialize an extension
// defn of:
//
// top.cpu.core*.extension.core_extensions:
// name: value
// name: value
//
// As:
//
// top.cpu.core0.extension.core_extensions:
// name: value
// name: value
//
// But the ParameterTree retains the wildcards in the path.
handleNode_(extensions_ptree->getRoot());
if (extensions_ptree) {
// Note we use the ParameterTree to get the tree node extensions instead
// of the device tree since using the device tree might serialize an extension
// defn of:
//
// top.cpu.core*.extension.core_extensions:
// name: value
// name: value
//
// As:
//
// top.cpu.core0.extension.core_extensions:
// name: value
// name: value
//
// But the ParameterTree retains the wildcards in the path.
handleNode_(extensions_ptree->getRoot());
}

*emitter_ << YP::EndDoc;
sparta_assert(emitter_->good());
Expand Down
6 changes: 3 additions & 3 deletions sparta/test/TreeNode/TreeNode_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ int main()
sparta::ConfigEmitter::YAML param_out(filename_orig,
true); // verbose

EXPECT_NOTHROW(param_out.addParameters(&top, true)); // verbose
EXPECT_NOTHROW(param_out.addParameters(&top, nullptr, true)); // verbose

// Ensure taht the read count on this crazy parameter has not changed
// when emitting the YAML
Expand All @@ -1128,7 +1128,7 @@ int main()
// Store Parameter Tree
sparta::ConfigEmitter::YAML param_out(filename_new,
false); // Terse
EXPECT_NOTHROW(param_out.addParameters(&top, false));
EXPECT_NOTHROW(param_out.addParameters(&top, nullptr, false));

// Reset read counts to write them again
recurs_reset(&top);
Expand All @@ -1144,7 +1144,7 @@ int main()
// Store Parameter Tree
sparta::ConfigEmitter::YAML param_out(filename_new,
true); // Verbose
EXPECT_NOTHROW(param_out.addParameters(&top, false));
EXPECT_NOTHROW(param_out.addParameters(&top, nullptr, false));

// Reset read counts to write them again
recurs_reset(&top);
Expand Down

0 comments on commit 05ba853

Please sign in to comment.