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

PA1 reference answers and grading script #396

Closed
lauren-yrluo opened this issue Oct 14, 2021 · 2 comments
Closed

PA1 reference answers and grading script #396

lauren-yrluo opened this issue Oct 14, 2021 · 2 comments
Labels
PA1 Programming Assignment 1

Comments

@lauren-yrluo
Copy link

lauren-yrluo commented Oct 14, 2021

I added a grading script that will be used to grade your solutions.

The usage of the script is:

Usage: ./lsv_fall_2021/admin/grade-submissions.sh <ALL|branch-name>
ALL: grade ALL students
branch-name: the branch to grade, e.g., d04943019

If your code is in <branch>, just type ./lsv_fall_2021/admin/grade-submissions.sh <branch>.
Your branch has been synchronized with the master branch. Therefore, to obtain the above updates is to synchronize your local branch with the upstream branch (i.e., the branch with your student ID number). Please refer to issue #338 for syncing your local branch.

For part 1, 5 points will be given if your BLIF is equivalent with the reference BLIF, where the equivalence is decided by ABC command dsec -n.

For part 3, the grading script compares the reference answers and outputs of a student's program. The comparison is done by diff -uwiB <ref.txt> <out.txt>, which ignores all white space, blank lines, and case differences.
We will use 20 test cases from the EPFL benchmark suite.
4 points will be given if the return code of diff equals 0 for each test case.
For the script to find the test cases, you have to create a symbolic link to the EPFL benchmark suite as described here.

You are encouraged to test your solution, and please speak up if there is any problem with the grading script or reference answers.

@lauren-yrluo lauren-yrluo added the PA1 Programming Assignment 1 label Oct 14, 2021
@kevinchang73
Copy link

kevinchang73 commented Oct 15, 2021

@Luo-Yun-Rong Hi TA, for the case "ctrl.aig", the reference answer tells the first MSFC is {n0}. However, there is no "n0" node when I use lsv_print_nodes (the example command). Similar situations also occur in "i2c", "mem_ctrl", "router" and "square". So, I wonder if Abc_NtkForEachNode may miss some nodes or the answers may be incorrect? Thanks a lot!

@lauren-yrluo
Copy link
Author

lauren-yrluo commented Oct 15, 2021

Thanks. It is a good observation. You may refer to abc.h and notice that objects may have following types.

// object types
typedef enum { 
    ABC_OBJ_NONE = 0,   //  0:  unknown
    ABC_OBJ_CONST1,     //  1:  constant 1 node (AIG only)
    ABC_OBJ_PI,         //  2:  primary input terminal
    ABC_OBJ_PO,         //  3:  primary output terminal
    ....
    ABC_OBJ_NODE,       //  7:  node
    ....
} Abc_ObjType_t;

The iterator Abc_NtkForEachNode only gives you objects with type ABC_OBJ_NODE.

#define Abc_NtkForEachNode( pNtk, pNode, i )                                                       \
    for ( i = 0; (i < Vec_PtrSize((pNtk)->vObjs)) && (((pNode) = Abc_NtkObj(pNtk, i)), 1); i++ )   \
        if ( (pNode) == NULL || !Abc_ObjIsNode(pNode) ) {} else
static inline int   Abc_ObjIsNode( Abc_Obj_t * pObj )   { return pObj->Type == ABC_OBJ_NODE;    }

You may miss the constant object with type ABC_OBJ_CONST1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PA1 Programming Assignment 1
Projects
None yet
Development

No branches or pull requests

3 participants