masc-ucsc / livehd Goto Github PK
View Code? Open in Web Editor NEWLive Hardware Development (LiveHD), a productive infrastructure for Synthesis and Simulation
License: Other
Live Hardware Development (LiveHD), a productive infrastructure for Synthesis and Simulation
License: Other
Must search across code for other API cases. Any return and pass of "std::string foo" should be const "std::string &foo" when possible.
Function parameter '_function' should be passed by reference.
void set_function(std::string _function) { function = _function; }
CodeFactor found an issue: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
It's currently on:
test\abc.sh:26
Member variable 'Tech_cell::height' is not initialized in the constructor.
Tech_cell(std::string name, uint16_t id) : cell_name(name), id(id) {}
struct member 'index_bits::bits' is never used.
int bits[2];
Function parameter 'path' should be passed by reference.
LGraph_WireNames::LGraph_WireNames(std::string path, std::string name)
The current pass directory structure has:
cse/
dce/
droute/
fluid/
gvn_pre/
lgopt/
lgopt_dce/
lgopt_fluid/
lgopt_gvn_pre/
vectorize/
The lgopt_* only have binaries for the respective passes (lgopt_dce and dce for instance).
We should get rid of the lgopt_ directories, either through the python interface or by using the shared lgopt/ binary.
However, there are test inputs in some of those directories that need to be preserved.
The regression tests also need to be updated to take the new location of the test inputs into account.
Uninitialized variable: pObj
Abc_NtkForEachNode(pNtk, pObj, k) {
Hi Rafael,
I saw this, but I did not want to fix because you are working on it. The idea is to avoid code replication:
Found 6 duplicate lines with fingerprint b53414fc0bea3244708a22d18c9af296 in the following files:
Between lines 256 and 264 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Between lines 152 and 160 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Found 6 duplicate lines with fingerprint 82e00c78ebbd6bb2f90f7fcdca435c5e in the following files:
Between lines 886 and 891 in /mada/users/renau/projs/lgraph/core/lgraphbase.cpp
Between lines 849 and 854 in /mada/users/renau/projs/lgraph/core/lgraphbase.cpp
Found 9 duplicate lines with fingerprint 01907d7871adaef31d4f05c1fb573cf1 in the following files:
Between lines 191 and 203 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Between lines 298 and 310 in /mada/users/renau/projs/lgraph/core/lgedgeiter.hpp
Function parameter '_path' should be passed by reference.
Tech_library(std::string _path) {
Exception should be caught by reference.
} catch (std::exception e) {
Function parameter 'name' should be passed by reference.
Tech_cell(std::string name, uint16_t id) : cell_name(name), id(id) {}
In general, we should change all the
std::string xxx pass to methods to
const std::string &xxx
Function parameter 'instance' should be passed by reference.
Graph_Node(LGraph* module, Index_ID idx, uint32_t bit, std::string instance, Port_ID pid) :
Tips depend on target shell and yours is unknown. Add a shebang.
Function parameter 'out' should be passed by reference.
void Inou_trivial::generate(std::vector<const LGraph *> out) {
Unused import glob
import glob
Class 'Tech_library' has a constructor with 1 argument that is not explicit.
Tech_library(std::string _path) {
Unused import argparse
import argparse
Use Node_Internal_Page to keep the file size in the first one. 4K savings :)
Use the clang code coverage compilation (gather stats only for lgraph, no subs)
http://logan.tw/posts/2015/04/28/check-code-coverage-with-clang-and-lcov/
Run the code coverage with Jenkins
Integrate with codecov to upload the generated code coverage to codecov
https://github.com/codecov/example-cpp11-cmake
Class 'Inou_trivial' has a constructor with 1 argument that is not explicit.
Inou_trivial(Options_pack opt) : opack(opt) {}
Undefined behaviour, pointer arithmetic 'val-1' is out of bounds.
RConstPodIterator rend() const { return RConstPodIterator(val-1); }
The code is there for the forward, the backward is NOT. Bogus code.
We use to have a reverse edge method when the graph was unidirectional. The code is all over. We should remove it and make sure that the removed places work fine.
Uninitialized variable: pTerm
Abc_NtkForEachPi(pNtk, pTerm, i) {
Class 'RConstPodIterator' has a constructor with 1 argument that is not explicit.
RConstPodIterator(const DataType *ptr): ptr(ptr){}
fprintf format string requires 3 parameters but only 2 are given.
fprintf(fout, "- MACRO %s THRUPIN %s %s ",
Return value of function log() is not used.
log("\n");
Memory leak: xl
CHECK_STATUS(status);
Variable 'pObj->pData' is reassigned a value before the old one has been used.
pObj->pData = Hop_And((Hop_Man_t *) pAig->pManFunc, Hop_IthVar((Hop_Man_t *) pAig->pManFunc, 0),
Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
p = nullptr;
It is a problem to copy Graph_Nodes by mistake (edges) get out of graph, and stops working properly.
Difficult bugs to catch.
The solution is to avoid a public constructor for Graph_Node and lgedges
Unused import sys
import sys
graph->flatten(std::vector subs);
This flatten command would flatten to the main graph calling the subgraphs included in list. If list if empty, it flattens (recursively) everything.
Statements following return, break, continue, goto or throw will never be executed.
assert(false); // Not found all over
After nodes are deleted, we want to reuse the space opened for new nodes.
Since we need a binary for our python, we need to create what is called a bdist_wheel in pip
https://packaging.python.org/tutorials/distributing-packages/
The issue is that to create a bdist, we need to use an old linux (centos) which in python world, is called manylinux1
https://www.python.org/dev/peps/pep-0513/
To do so, we should create a centos docker image (see previous link for prebuild image), and compile
the python package (lgraph) inside.
Let's create this as a first step with a simple "hello" in C++ class using the lgraph pip package.
The login is renau
The pip password for lgraph is XXX (send me an email to ask)
Created the docs/Python.md to document how to build python, upload, and use
Current forward/backward does not visit subgraphs. It can be done manually opennning
the subgraph, but not neat.
The idea is to have the same forward/backward/fast iterators but with a non default option of also traversing subgraphs.
(Add a loop detector and raise exception of needed)
struct member 'tech_layer_s_::spctb_prl' is never used.
double spctb_prl; // parallel running length
The scope of the variable 'Command' can be reduced.
char Command[1000];
The scope of the variable 'pNet' can be reduced.
Abc_Obj_t *pTerm, *pNet;
struct member 'tech_layer_s_::horizontal' is never used.
bool horizontal;
CFG just needs type, srcloc
Synth only, does not need place,route....
At graph open, we should populate only if fields are needed. Assertion checking otherwise.
The graph storage should remember fields are load-time. If we force a new field, we may want to use the default contructor. Eg: if we get a synth graph, and add place, we just put 0 for all the placement fields.
Uninitialized variable: pLatch
Abc_NtkForEachLatch(pNtk, pLatch, i) {
Class 'mmap_allocator' has a constructor with 1 argument that is not explicit.
mmap_allocator(const std::string& filename) : mmap_base(0), file_size(0), mmap_size(0), mmap_capacity(0), mmap_fd(-1), alloc(0), mmap_name(filename) {
Uninitialized struct member: aPin.dir
pins.push_back(aPin);
The current inou class has "generate" and parses the parameters.
Change to the interface to prepare for python integration. Remove the generate, and replace with an interface similar to the python
lgraph.inou.path = "./lgdb" # lgraph.inou.set_path(const std::string &path)
lgraph.open("xx", [options]) # Raw graph in lgdb path
lgraph.rand.read("graph_name", [some options])
lgraph.rand.xxx = xxx # sets one of the options. in C++ set_xxx(xxx)
lgraph.json.read("file", ["graph_name"])
lgraph.json.write("file", [some options])
lgraph.json.xxx = xx # sets one option like (compressed json or not)
lgraph.pyrope.read() # Not suported in pyrope
lgraph.pyrope.write("file.prp")
lgraph.pyrope.xxx = xx # options like indentation...
The arguments would be processed in the lg*.cpp main file.
The tests for abc runtime are pretty high.
I assume it is the checking, since all other tasks should be pretty fast.
Check if there are options to try to speed up the check.
If we are able to move to yosys for the testing (which include generating verilog) the tests should be faster (they should be roughly the same as for the yosys inou tests).
fprintf format string requires 4 parameters but only 2 are given.
fprintf(stderr,"lima_node%d:%d -> node%d:%d TSTbck\n"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.