-
Notifications
You must be signed in to change notification settings - Fork 58
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
fusion draft PR commit #135
Conversation
fusion/test/CMakeLists.txt
Outdated
|
||
|
||
|
||
#cmake_minimum_required(VERSION 3.17) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
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
A few general comments (nits):
Started looking at the implementation. Have some comments pending. |
There was a problem hiding this 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.
fusion/test/testbench.cpp
Outdated
unordered_map<string, fusion::HashType> & exp, | ||
const FusionType::FusionGroupCfgListType & in) | ||
{ | ||
using FBASE = fusion::FusionGroupBase; |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
fusion/dsl/qparser.cpp
Outdated
|
||
// ---------------------------------------------------------------- | ||
// ---------------------------------------------------------------- | ||
bool QParser::parse(string fn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably be const &
There was a problem hiding this comment.
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>. |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
fusion/dsl/README.md
Outdated
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
fusion/fusion/fieldextractor.h
Outdated
}; | ||
|
||
//! \brief placeholder | ||
void info(std::ostream & os = std::cout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method can be const
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
fusion/fusion/fieldextractor.h
Outdated
//! | ||
//! 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 |
There was a problem hiding this comment.
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 const
s ( 😆 ), I have a huge issue with single letter variable names for one main reason: search for f
in this function. 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
fusion/fusion/fusion.h
Outdated
Fusion() : | ||
Fusion({}, {}, {}, FusionGroupTypeAlloc(), | ||
MachineInfoTypeAlloc(), FieldExtractorType()) | ||
{ | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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;
fusion/fusion/fusion.h
Outdated
} | ||
|
||
//! \brief future file type detector | ||
bool isJsonFile(std::string fn) { return false; } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
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
I have posted a PR for the Fusion API alone. We will continue the DSL syntax discussion. |
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 :