d-m-bailey / extra_be_checks

Extra backend checks for sky130
Apache License 2.0
6 stars 3 forks source link

Bug in running CVC #29

Closed marwaneltoukhy closed 1 year ago

marwaneltoukhy commented 1 year ago

Not sure why this line is here, but it is causing the path to be wrong, my solution was

-BASE_NAME=${DESIGN_NAME//[A-Z0-9][A-Z0-9]_/} # remove leading 2 byte prefices
-if [[ (! -f $WORK_ROOT/$DESIGN_NAME/$DESIGN_NAME.power) && -f $LVS_ROOT/cvc/$BASE_NAME.$PDK.power ]]; then
-       cp $LVS_ROOT/cvc/$BASE_NAME.$PDK.power $WORK_ROOT/$DESIGN_NAME/$DESIGN_NAME.power
+# BASE_NAME=${DESIGN_NAME//[A-Z0-9][A-Z0-9]_/} # remove leading 2 byte prefices
+if [[ (! -f $WORK_ROOT/$DESIGN_NAME/$DESIGN_NAME.power) && -f $LVS_ROOT/cvc/$DESIGN_NAME.$PDK.power ]]; then
+       cp $LVS_ROOT/cvc/$DESIGN_NAME.$PDK.power $WORK_ROOT/$DESIGN_NAME/$DESIGN_NAME.power
d-m-bailey commented 1 year ago

@marwaneltoukhy Thanks. Probably should anchor it to the front. make ship will add 2 byte random prefixes to sub blocks including user_project_wrapper. This gives something like A7_user_project_wrapper. However, this block does not have a default power definition while user_project_wrapper does. What path is incorrect?

marwaneltoukhy commented 1 year ago

Not sure if what I'm going to claim is accurate so please correct me if I'm wrong; make ship will only add those 2 bytes if the error we saw/debugged earlier last week happens, where it tries to read in two files with the same name, once gds and once mag. If that's the case then that's something wrong with the build script that needs to be fixed.

Also, in my case I'm running directly on user_project_wrapper so I don't actually run make ship so that line messes with the name of the cell user_project_wrapper which is correctly defined in the variable DESIGN_NAME to make it something else, meaning the script is searching for the wrong cell name.

d-m-bailey commented 1 year ago

Not sure where the extra 2 byte prefix comes from either, but all the oasis files have it.

${DESIGN_NAME//[A-Z0-9][A-Z0-9]_/} this is just a global substitution on the DESIGN_NAME value - globally replacing [A-Z0-9][A-Z0-9]_ with nothing. If DESIGN_NAME is user_project_wrapper, it shouldn't change anything.

marwaneltoukhy commented 1 year ago

It changes user_project_wrapper to usprojewrapper

d-m-bailey commented 1 year ago

Can't logon right now. Can you try adding

shopt -u nocasematch

before

BASE_NAME=${DESIGN_NAME//[A-Z0-9][A-Z0-9]_}

(edit). I'll add it to the script.

d-m-bailey commented 1 year ago

Here's a comparison:

user@chipignite-clear-dv-01:~/$ shopt nocasematch
nocasematch     off
user@chipignite-clear-dv-01:~/$ test_cell=AF_user_project_wrapper
user@chipignite-clear-dv-01:~/$ echo ${test_cell//[A-Z0-9][A-Z0-9]_}
user_project_wrapper

user@chipignite-clear-dv-01:~/$ shopt -s nocasematch 
user@chipignite-clear-dv-01:~/$ shopt nocasematch
nocasematch     on
user@chipignite-clear-dv-01:~/$ echo ${test_cell//[A-Z0-9][A-Z0-9]_}
usprojewrapper

user@chipignite-clear-dv-01:~/$ shopt -u nocasematch 
user@chipignite-clear-dv-01:~/$ shopt nocasematch
nocasematch     off
user@chipignite-clear-dv-01:~/$ echo ${test_cell//[A-Z0-9][A-Z0-9]_}
user_project_wrapper
d-m-bailey commented 1 year ago

I think this is fixed with shopt -u nocasematch, so I'll close it.

@marwaneltoukhy Please reopen if there are still problems.