Skip to content

New primitive hard block support titan flow #1876

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

Merged
merged 31 commits into from
Nov 12, 2021

Conversation

Srivat97
Copy link
Contributor

Added support to process designs that contain new types of hard blocks.

Description

When new primitive hard blocks are included in a design, the Quartus synthesis tool does not correctly include the hard blocks
within the generated vqm netlists. Instead of directly instantiating the hard block within the netlist (which occurs for BRAM or DSP blocks), LUTs and DFFs have been added in place of the ports of each hard block within the design.

The feature added in this PR goes through netlists that contain hard blocks and remove the unnecessary LUTs and DFFs and in their place instantiate the corresponding hard block. The resulting blif file correctly includes all the hard blocks.

Related Issue

Motivation and Context

Titan Flow currently does not support new types of hard blocks, so designers would have to manually add the hard blocks to the netlist. This feature automates the previous step and quickly allows designers to perform tests and evaluate architectures with new types of hard blocks.

How Has This Been Tested?

The following tests were performed:

  • A custom design with a new type of hard block was used to verify the functionality of the new feature
  • Sanitization and Valgrind tests were also performed
  • The existing Titan23 circuits were used to verify that the new feature did not modify prior results

Types of changes

  • Bug fix (change which fixes an issue)
  • [ x] New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x ] My change requires a change to the documentation
  • I have updated the documentation accordingly
  • [x ] I have added tests to cover my changes
  • [ x] All new and existing tests passed

@Srivat97 Srivat97 requested a review from vaughnbetz October 15, 2021 19:10
Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

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

Looks mostly good; I have some suggestions for commenting improvements and typo fixes and a few coding cleanups to consider. If the coding cleanups are going to turn into a lot of work or you don't agree with them let me know (just reply to the conversation). If you agree, good to resolve the comment once you make a change.

/*
* The purpose of this file is to support netlists that
* contain new types of hard blocks. Specifically, user defined
* hard blocks are indetified within the netlist and then instantiated
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: identified

std::string - the name of the Quartus generated netlist file (".vqm")
*
*/
void add_hard_blocks_to_netlist(t_module*, t_arch*, std::vector<std::string>*, std::string, 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.

  1. Give each of these input parameters names in the function prototype, as it improves readability. E.g.:
    t_module* netlist, t_arch* fpga_arch, std::vectorstd::string* hb_names, std::string arch_file, std::string vqm_file)

  2. If you're just passing things by reference, using std::vectorstd::string& is more clear (and easier to read in the .cpp function body). If you don't change the object passed by reference (you're just passing a pointer to a big object for speed) then use a const reference, e.g.
    const std::vectorstd::string&

…ality to parse nodes that represent hard block ports in vqm netlist
… them to existing module node array. ALso added functionality to quikly find newly created hard block instances (their node in the module and additional info)
… functionality to assign nets to newly created hard block instance ports.
…lock output ports. Also fixed some naming conventions (hard block model -> hard block type)
…e port has multiple nets connected to it. Also, now the number of assigned ports for each hard block instance is properly tracked.
…ock instance port, we identify the port connected to the net, this way we can also extract wire index information when assigning net to the hard block instance port. Also updated some definitions.
… they would correctly indicate that the port was not a bus
… repersent hard blocks ports can be removed from the module now
…ard block in the netlist has a net assigned to it
@Srivat97 Srivat97 force-pushed the new_primitive_hard_block_support_titan_flow branch from 34d7b3f to 78d4c27 Compare November 2, 2021 21:50
…re and also added parameter names to function prototypes
…erated vqm file. Now the program includes a device option that automatically loads the parameters for a given device.
@Srivat97
Copy link
Contributor Author

@vaughnbetz I resolved most of the changes you had, but there were a few changes that I commented on. Let me know your thoughts on them.

Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

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

Looks good Srivatsan. This can be merged once CI goes green.
I added a couple of minor comment notes / typo that wasn't fixed, but those can be changed after the initial merge.
Also, you can reply to comments in a code review by typing in the "reply" box; that way the conversation will show up with your responses under your name (so it's a bit more clear than editing my notes).

* within the list. The ports and their indexing is stored.
*
* @param main_arch This contains all the information regarding the FPGA
* architeture that the design will be mapped to.
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think architecture is misspelt (architeture -> architecture)

@vaughnbetz
Copy link
Contributor

There's one spurious QoR failure:
vtr_reg_nightly_test1/arithmetic_tasks/multless_consts...[Fail]
[Fail]
fixed_k6_frac_N8_22nm.xml/mult_057.v/common min_chan_width_route_time relative value 14.643312101910826 outside of range [0.1,14.0], above absolute threshold 2.0 and not equal to golden value: 1.57

But that isn't a major concern (min chan width route time bounces around) and it isn't related to your change. Merging.

@vaughnbetz vaughnbetz merged commit 0994698 into master Nov 12, 2021
@vaughnbetz vaughnbetz deleted the new_primitive_hard_block_support_titan_flow branch November 12, 2021 14:27
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