-
Notifications
You must be signed in to change notification settings - Fork 415
Pass Netlist to Router #2170
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
Comments
Sanitizer Output FileHere is one of the output files when -fsanitize=undefined is enabled. Valgring Output FileHere, you can find the output of running Valgrind on the same program that sanitizer was run on it. As you can see, Valgrind did not raise any error. Sample Sanitizer Error:There are some errors: Direct leak of 32 byte(s) in 1 object(s) allocated from: SolutionThese errors are complaining about accessing a ClusterNetlist type while Netlist is expected. As I explained in the previous comment, ClusterNetlist is inherited from Netlist. To pass the CI Tests, I remove "-fsanitize=undefined" from sanitizer flags in CMake file. Any Suggestion?@hzeller: This kind of inheritance was the fastest way I could think about to get the flat_routing running. For the future, I am thinking about creating another class, e.g. RouterNetlist, which has a reference to both netlists and use that in the routing functions. If you have any other suggestions on how to implement it, I would appreciate it. |
|
There also appears to be a finer granularity to turn off error checking in the sanitizers, so possibly we could turn off less (although it seems we'd have to specify a lot of options then, as undefined is a catch all for ~30 checks. |
1: The attached file is for a run that the minimum channel width is not specified, so router is called several times. For the first router run, it printed out some errors, but for the subsequent runs, it didn't print anything. 2: I ran the master branch with the same argument as the attached output files, and it did not print the same errors. I checked the reported leaks related to calling "net_is_global" function, and since these error are being raised during routing, based on the printed function call hierarchy, I believe they are caused by casting Clustered/AtomNetlist to Netlist. 3: I am already using explicit type casting. When I want to pass a ClusterNetlist or an AtomNetlist to a function, I should do an explicit type casting. This is because the parent netlist class is a template class. Thus, if I want to do a normal upcasting, the template values for the Netlist class that the function accepts should be equal to the template values of the Netlist Class which ClusterNetlist is inherited, which is not the case. The template values for the function's netlist are: ParentNetId, ParentBlockId, etc, and the Netlist's template values that ClusterNetlist is inherited from are: ClusterNetId, ClusterBlockId, etc. |
Problem
To enable flat_routing in VPR, router should be able to work with both ClusteredNetlist and AtomNetlist. To do so, I added a parameter of type Netlist, the parent class for the mentioned classes, to router functions.
The problem is that Netlist is a template class, and the template values for ClusterNetlist and AtomNetlist are different. To circumvent this problem, I assigned a default template value to the Netlist class and inherited AtomNetlist and ClusteredNetlist template values from that. Now, I can pass ClusteredNetlist or AtomNetlist to a function that accepts Netlist.
However, since the template values for ClusterNetlist(or AtomNetlist) and Netlist are different, sanitizer raises errors whenever Netlist is accessed during routing.
Defenition of Netlist:
template < typename BlockId = ParentBlockId, typename PortId = ParentPortId, typename PinId = ParentPinId, typename NetId = ParentNetId>
class Netlist { ... }
Defenition of AtomNetlist:
class AtomNetlist : public Netlist<AtomBlockId, AtomPortId, AtomPinId, AtomNetId> { ... };
Definition of ClusteredNetlist:
class ClusteredNetlist : public Netlist<ClusterBlockId, ClusterPortId, ClusterPinId, ClusterNetId> { ... };
Ids:
AtomBLockId and ClusterBlockId are inherited from ParentBLockId, AtomNetId and ClusterNetId are inherited from ParentNetId, and so on.
Example of a function that accepts Netlist:
static bool try_timing_driven_route_tmpl(const Netlist<>& netlist, .. );
How I pass Netlist to the function:
try_timing_driven_route_tmpl((const Netlist<>&) g_vpr_ctx.atom().nlist, .. );
@vaughnbetz @hzeller
The text was updated successfully, but these errors were encountered: