Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fusion draft PR commit #135

Closed

Conversation

jeffnye-gh
Copy link
Collaborator

Contains the draft version of the fusion API and start of a test bench. Doxygen file provided also. README.md has the gist.
fusion/test/testbench.cpp has some usage.

The API is more general, simpler, better alignment with other source and existing packages (mavis).

See the README.md or front page of doxygen. API uses functor's at the top level and within the inner transform operations for generality. There are examples of each, including a lambda example.

FieldExtractor (mavis) and MachineInfo (future CoreExtensions ?) are template parameters.

To run the test bench and generate docs @ fusion/html/index.html :

cd fusion
mkdir -p release; cd release
cmake ..
make -j32 regress
make docs




#cmake_minimum_required(VERSION 3.17)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these dead directives are not intended.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Jeff Nye added 4 commits January 11, 2024 17:03
refactor long testbench file

Added special field extract method, fieldextractor test

FSL: domain language has a name, fusion script (or spec) language
Add fsl grammar and lexer, fsl.l/.y
Add symbol table support
Added syntax check tests

Local copies of json and test files

Reapplied clang-format
refactor long testbench file

Added special field extract method, fieldextractor test

FSL: domain language has a name, fusion script (or spec) language
Add fsl grammar and lexer, fsl.l/.y
Add symbol table support
Added syntax check tests

Local copies of json and test files

Reapplied clang-format
@klingaard
Copy link
Collaborator

klingaard commented Jan 21, 2024

A few general comments (nits):

  1. The header files should be .hpp
  2. The header files in olympia are named exactly (case included) as the class they represent. However, this rule isn't documented in the CodingStyleGuide
  3. Noticed some files copied from Mavis. Mavis didn't follow a lot of the styles adopted by Olympia (for example using #ifdef instead of #pragma once for header guards). Do you mind making them consistent with Olympia's style?
  4. Function names do not match the coding style guide -- they lower_lower for example...
  5. Any single line conditionals will need to be encapsulated in {}

Started looking at the implementation. Have some comments pending.

Copy link
Collaborator

@klingaard klingaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments for now -- some mostly nits. I'd like to run the tester and step through it with the debugger to understand the flow a bit. But, this a awesome.

unordered_map<string, fusion::HashType> & exp,
const FusionType::FusionGroupCfgListType & in)
{
using FBASE = fusion::FusionGroupBase;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to be used...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


// ----------------------------------------------------------------
// ----------------------------------------------------------------
bool QParser::parse(string fn)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably be const &

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 2024.1.22 push


The currently considered procedure for Fusion is an implementation in a
Sparta unit typically in the Decode. The primary input to the
fusionOperator() is a form of the InstQueue, sparta::Queue<InstPtr>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess that the operator is templatized (unless a lambda) that can take any type of iterable.

4. uarch oly1
5. input_seq in_seq
6.
7. sequence seq1(in_seq,rv64g) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the rv64g here is redundant since the fusion defines this on line "3"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be, rv64g is a reference to the isa decl object on line 162. I've kept the arg list for this version so that when a sequence decl is a top level object it is consistent. This is not well documented.

I think we should have a discussion on the dsl syntax. I threw something out there as a strawman.

fusion/dsl/fsl.l Outdated

[\.]*[_a-z\.A-Z0-9]+ {
//E("ID")
yylval.sval = strdup(yytext);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, how will this mess with valgrind support once we've turned it on...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fingers crossed? i have not run valgrind on this parser.

Comment on lines 123 to 132
10. gpr g1,g2
11. s20 c1
12. s12 c2
13. u6 c3
14.
15. //The constraints declarations
16. g1 != g2 // C3, the contrived constraint
17. // In this version of the syntax the
18. transform t1 // scope of sequence and constraints is
19. // within this fusion_decl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing the constraints keyword?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this text is old, needs an update.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've remove this file for now. When we've had time to discuss the syntax/grammar there would be an update to this text.

};

//! \brief placeholder
void info(std::ostream & os = std::cout)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method can be const

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest making the method a template on the ostreamT

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the placeholder method

//!
//! handles field name and immediate checking
//! \note RS_MAX is overloaded to identify get's for immediate fields
uint32_t getField(InstPtrType inst, FieldName f) const
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, outside of complaining about missing consts ( 😆 ), I have a huge issue with single letter variable names for one main reason: search for f in this function. 😱

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment on lines 123 to 127
Fusion() :
Fusion({}, {}, {}, FusionGroupTypeAlloc(),
MachineInfoTypeAlloc(), FieldExtractorType())
{
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, does this ctor have any value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bare FusionType was instantiated in the testbench compile checks test. Removing the instance eliminates the need for it.

//Removed FusionType f1;

}

//! \brief future file type detector
bool isJsonFile(std::string fn) { return false; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method can be const. probable want to (void) out fn or drop it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Jeff Nye added 2 commits January 22, 2024 09:57
coding style and file name changes

functional changes are minimal, symbol table expect vs
actual comparison code

removed dated dsl/README
…nye-gh/fusion_dpr

update top level README.md
@jeffnye-gh jeffnye-gh marked this pull request as ready for review January 29, 2024 20:31
@jeffnye-gh jeffnye-gh closed this Jan 29, 2024
@jeffnye-gh
Copy link
Collaborator Author

I have posted a PR for the Fusion API alone. We will continue the DSL syntax discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants