GithubHelp home page GithubHelp logo

Comments (6)

soheilshahrouz avatar soheilshahrouz commented on September 26, 2024

Thank you for opening this issue.

It seems that some move generators call pick_from_block() function to select a block randomly. This function has a while loop that tries to find a movable block. Since all blocks in your run are fixed, this loop's exit condition is not met until all possible options (all clustered blocks) are exhaused.

ClusterBlockId pick_from_block() {
/* Some blocks may be fixed, and should never be moved from their *
* initial positions. If we randomly selected such a block try *
* another random block. *
* *
* We need to track the blocks we have tried to avoid an infinite *
* loop if all blocks are fixed. */
auto& cluster_ctx = g_vpr_ctx.clustering();
auto& place_ctx = g_vpr_ctx.mutable_placement();
std::unordered_set<ClusterBlockId> tried_from_blocks;
//Keep selecting random blocks as long as there are any untried blocks
//Can get slow if there are many blocks but only a few (or none) can move
while (tried_from_blocks.size() < cluster_ctx.clb_nlist.blocks().size()) {
//Pick a block at random
ClusterBlockId b_from = ClusterBlockId(vtr::irand((int)cluster_ctx.clb_nlist.blocks().size() - 1));
//Record it as tried
tried_from_blocks.insert(b_from);
if (place_ctx.block_locs[b_from].is_fixed) {
continue; //Fixed location, try again
}
//Found a movable block
return b_from;
}
//No movable blocks found
return ClusterBlockId::INVALID();
}

If you want to skip placement altogether, I guess you can pass the placement file using --place_file option.

@vaughnbetz What is you opinion on this? Should I change pick_from_block() function? We can fix this by trying only a few clustered blocks to find a movable one. Alternatively, we can store all movable blocks in a separate container and select an element of this container randomly.

from vtr-verilog-to-routing.

vaughnbetz avatar vaughnbetz commented on September 26, 2024

Thanks @soheilshahrouz . Probably we should put all the movable blocks (and only movable blocks) in a container and select them randomly, so we are always efficient.

from vtr-verilog-to-routing.

rachelselinar avatar rachelselinar commented on September 26, 2024

I was able to convert a .fix_clusters file to a .place file by including '0' subtile entry for all entries and appending netlist checksum and array information as a header.

By passing the .place file using the --place_file option, router ran successfully (and much faster) and the results are the same.

Thank you

from vtr-verilog-to-routing.

vaughnbetz avatar vaughnbetz commented on September 26, 2024

Great, thanks Rachel. I think without the checksum it will just give a warning, so if that's a pain to maintain I think you can skip it (it's intended to protect people from accidentally using a .place file for the wrong circuit or architecture).

from vtr-verilog-to-routing.

rachelselinar avatar rachelselinar commented on September 26, 2024

I was able to obtain the netlist checksum and array size information from runs that did not fix all clusters in the .fix_clusters file. In addition, VPR placer errors out if the .place file doesn't have these 3 lines in its header

  1. Netlist checksum
  2. Array size

Without either (or 3 empty lines as header), placer errors out at the first entry:
_

Error 1:
Type: Placement file
File: ../gaussianblur.place
Line: 3
Message: Invalid line 'step0:grp_step0_fu_168|step0_grp_fu_2167_ACMP_fmul_6:step0_grp_fu_2167_ACMP_fmul_6_U|ACMP_fmul:ACMP_fmul_U|AESL_WP_FMul:ACMP_FMul_U|lpm_mult:Mult0|mult_8at:auto_generated|mac_mult2 166 126 0 0 #0' in placement file header

_

  1. Empty line

If only the checksum and array size is provided without an empty line, the placer errors out:

_

Error 1:
Type: Placement
File: ~/vtr-verilog-to-routing/vpr/src/base/read_place.cpp
Line: 297
Message: Block 0 has not been read from the place file.

_

For gaussianblur, the .place file generated by VPR placer contains this header:

Netlist_File: gaussianblur.net Netlist_ID: SHA256:d6e68433c9959dc959dc0758f8f9f026cd79b00d8fbbfce6c211b820e50589dd
Array size: 400 x 296 logic blocks

#block name x y subblk layer block number
#---------- -- -- ------ ----- ------------

from vtr-verilog-to-routing.

vaughnbetz avatar vaughnbetz commented on September 26, 2024

Thanks; we should probably make this a bit more robust (keep parsing and give a warning).

from vtr-verilog-to-routing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.