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

coprocessor generator #280

Open
wants to merge 7 commits into
base: fugen-verilog-fixes
Choose a base branch
from

Conversation

hfthra
Copy link

@hfthra hfthra commented Mar 20, 2025

No description provided.

Copy link
Contributor

@pjaaskel pjaaskel left a comment

Choose a reason for hiding this comment

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

Getting to a good direction! Is this your first PR ever?

Please split this to multiple PRs with logical entities. For example, the FUGen could be submitted first and then the RISC-V support. Huge single commit PRs are difficult to review.

Also check the C++ style and comments. For example some of the classes/Types naming could be improved for readability, there are formatting issues (please check the clang formatter script and improve if needed).

Also a good habit is to describe what the PR brings in and why in the pull request comment.

@karihepola karihepola self-requested a review March 22, 2025 13:58

for (auto op : Ops_) {
if (op.first == operation) {
encF3 = (op.second & maskF3) >> 7;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use RISCVTools here so we don't duplicate the encoding logic?

protected:
// Finding RISCV custom Operations as in RISCVTDGEN
void
findCustomOps() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This functionality seems to be shared in RISCVTDGen. In this case, it should be moved to the RISCVTools class so we don't get duplicate code.


// RISCV format finder as in RISCVTDGEN
InstructionFormat*
findFormat(const std::string name) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@@ -951,7 +989,7 @@ namespace HDLGenerator {
} else if (lang == Language::Verilog) {
stream << "\n";
stream << StringTools::indent(level) << "// " << name() << "\n";
stream << StringTools::indent(level) << "always @*";
stream << StringTools::indent(level) << "always_comb";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is always_comb also supported by plain verilog?

assert(bem_ != NULL);
findCustomOps();
initializeBackendContents();
}

std::string
Copy link
Contributor

Choose a reason for hiding this comment

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

These methods should be removed. They are not used and have crept in somehow to this commit.

std::cout << "Usage: riscv-tdgen" << std::endl
<< " -o Output directory." << std::endl
<< " -a ADF path." << std::endl;
<< " -a ADF path." << std::endl
<< " -r 'T':Enable ROCC encodings, OR 'F'" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a default value to this? We want to run this command from the command line, and setting the coprocessor encoding type each time should not be necessary.

using std::string;
using std::vector;

int const DEFAULT_IMEMWIDTH_IN_MAUS = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Copyright (C) 2025 Tampere University.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not change the license of old files

@@ -1,25 +1,20 @@
/*
Copyright (c) 2002-2009 Tampere University.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Just use the old license.

int config_width_= 17; //17 bits for the config bits
int input_opcodeWidth_= opcodeWidth_ + config_width_;
int config_width_ = 17; // 17 bits for the config bits
int input_opcodeWidth_ = opcodeWidth_ + config_width_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Check the naming. C++ TCE style: inputOpcodeWidth_ etc.

//CVXIF generator enable
bool cvxifEN_= false;
// CVXIF generator enable
bool cvxifEN_ = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool cvxifEN_ = false;
bool generateCVXIF_ = false;

@@ -0,0 +1,120 @@
// Copyright (c) 2025 Tampere University of Technology.
Copy link
Contributor

Choose a reason for hiding this comment

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

TUT is long gone...

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.

3 participants