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

compositor.py error ignored in final target #564

Open
d-m-bailey opened this issue Feb 14, 2025 · 0 comments
Open

compositor.py error ignored in final target #564

d-m-bailey opened this issue Feb 14, 2025 · 0 comments

Comments

@d-m-bailey
Copy link
Contributor

@DavidRLindley @marwaneltoukhy

Testing the Makefile without the uncompress dependency. The programs are expected to handle compressed files implicitly and natively.

Running the make final recipe gives this

Error message output from magic:
Cell RAM128 couldn't be read
Warning:  Parent cell lists instance of "EF_fill_4_8" at bad file path /home/user/2504/caravel_user_project/dependencies/pdks/sky130A/libs.ref/sky130_fd_sc_hd/mag/EF_fill_4_8.mag.
The cell exists in the search paths at EF_fill_4_8.mag.
The discovered version will be used.
/home/user/2504/caravel_user_project/dependencies/pdks/sky130A/libs.tech/magic/sky130A.tech: line 6148: section (none):
        Unrecognized layer (type) name "res0p69"
ERROR:  Magic exited with status -11
Done!
#mv /home/user/pull_requests/caravel-ci2504-DEV/mag/caravel_25040001.mag ./mag/
make[2]: Leaving directory '/home/user/2504/cup-test'
Final build completed.
make[1]: Leaving directory '/home/user/2504/cup-test'

Magic ends with a status -11, but the Final build completed. message is still displayed and ends normally but the gds is invalid.

The scripts/compositor.py file ends with

    if mproc.stderr:
        # NOTE:  Until there is a "load -silent" option in magic, loading
        # a new cell generates an error.  This code ignores the error.
        newlines = []
        for line in mproc.stderr.splitlines():
            if line.endswith("_fill_pattern.mag couldn't be read"):
                continue
            if line.startswith("No such file or directory"):
                continue
            else:
                newlines.append(line)

        if len(newlines) > 0:
            print('Error message output from magic:')
            for line in newlines:
                print(line)
        if mproc.returncode != 0:
            print('ERROR:  Magic exited with status ' + str(mproc.returncode))

    if not keepmode:
        os.remove(user_project_path + '/mag/compose_final.tcl')

    print('Done!')
    exit(0)

Maybe it should exit with a non-zero return code like this.

        if mproc.returncode != 0:
            print('ERROR:  Magic exited with status ' + str(mproc.returncode))
            exit(mproc.returncode)

@RTimothyEdwards looks like magic is ending with a segfault.
The magic script is created in the Makefile in this file <project>/mag/compose_final.tcl.
Executing

magic -dnull -noc -rcfile $PDK_ROOT/sky130A/libs.tech/magic/sky130A.magicrc mag/compose_final.tcl 

from the project directory works.
However, the composite.py script executes in the $CARAVEL_ROOT/mag directory.
Executing in that directory gives

...
Cell font_69 read from path /home/kanobailey/2504/caravel_user_project/dependencies/pdks/sky130A/libs.ref/sky130_ml_xx_hd/mag
Scaled magic input cell font_69 geometry by factor of 24
Cell font_53 read from path /home/kanobailey/2504/caravel_user_project/dependencies/pdks/sky130A/libs.ref/sky130_ml_xx_hd/mag
Scaled magic input cell font_53 geometry by factor of 24
Segmentation fault

To reproduce,

git clone https://github.com/efabless/caravel_user_project --depth=1
cd caravel_user_project
make setup
rm -rf caravel
git clone https://github.com/d-m-bailey/caravel -b ci2504-DEV --depth=1
export USER_ID=25040001
export PROJECT=caravel
sed -i 's/GPIO_MODE_INVALID$/GPIO_MODE_USER_STD_ANALOG/' verilog/rtl/user_defines.v
make set_user_id
make gpio_defaults
make ship
make generate_fill
make final

The segfault message is lost, but you should be able to verify that the gds is bad.

Running this from the project directory should work.

magic -dnull -noc -rcfile dependencies/pdks/sky130A/libs.tech/magic/sky130A.magicrc mag/compose_final.tcl

but this will give the segfault error

export UPRJ_ROOT=$PWD
cd caravel/mag
magic -dnull -noc -rcfile $UPRJ_ROOT/dependencies/pdks/sky130A/libs.tech/magic/sky130A.magicrc $UPRJ_ROOT/mag/compose_final.tcl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant