chipsalliance / Cores-SweRV-Support-Package

Processor support packages
14 stars 7 forks source link

ModuleNotFoundError : No module named ssp #1

Closed kidonglee closed 3 years ago

kidonglee commented 3 years ago

I have an error message while installing ssp script. (refer to [log1] below) So, I installed ssp using pip, as below python3 -m pip install ssp But I have another error message after that. (refer to [log2] below) I don't know what the problem is. Please help me.

[python version] kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ python3 --version Python 3.6.9

[log1] kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ python3 -m pip install -r requirements.txt . Processing /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package Complete output from command python setup.py egginfo: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-opl652j-build/setup.py", line 3, in import ssp ModuleNotFoundError: No module named 'ssp'

----------------------------------------

Command "python setup.py egginfo" failed with error code 1 in /tmp/pip-opl652j-build/

[log2] kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ python3 -m pip install -r requirements.txt . Processing /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-0jjzmclv-build/setup.py", line 3, in import ssp File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/init.py", line 16, in from .core import * File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/core.py", line 18 print 'export {0}={1}'.format(param, environ[param]) ^ SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-0jjzmclv-build/

Codasip commented 3 years ago

The error message is a bit missleading - the reason is that you do not have permissions to write to python3 installation libs and bins and thus ssp wrapper could not be written there. Please use: python3 -m pip install -r requirements.txt --user when done add <your_home_dir/.local/bin to your search path. ssp wrapper shall be found there.

kidonglee commented 3 years ago

The error message is a bit missleading - the reason is that you do not have permissions to write to python3 installation libs and bins and thus ssp wrapper could not be written there. Please use: python3 -m pip install -r requirements.txt --user when done add <your_home_dir/.local/bin to your search path. ssp wrapper shall be found there.

Dear Codasip,

I tried the solution that you recommend but I got same results, as below, [command]

export PATH=$PATH:/home/kdlee/.local/bin/
python3 -m pip install -r requirements.txt . --user

[results]

Processing /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-0054bi11-build/setup.py", line 3, in <module>
        import ssp
      File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/__init__.py", line 16, in <module>
        from .core import *
      File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/core.py", line 18
        print 'export {0}={1}'.format(param, environ[param])
                             ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-0054bi11-build/

Please check if there are another problem.

Thanks.

Codasip commented 3 years ago

There is no core.py in our ssp installation. It looks like some unwanted artifact you have got there before. Please remove completely ssp* from your site-packages and install it again.

cd /home/kdlee/.local/lib/python3.6/site-packages; rm -rf ssp* cd /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package python3 -m pip install -r requirements.txt . --user

I hope it helps.

kidonglee commented 3 years ago

There is no core.py in our ssp installation. It looks like some unwanted artifact you have got there before. Please remove completely ssp* from your site-packages and install it again.

cd /home/kdlee/.local/lib/python3.6/site-packages; rm -rf ssp* cd /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package python3 -m pip install -r requirements.txt . --user

I hope it helps.

Dear Codasip, Thanks for the kind advice.

I tried the sequences you provided. But I got that same results as previous, as below. If you don't mind, please let me know if there are any other points that I check.

Thank you very much.

kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ cd /home/kdlee/.local/lib/python3.6/site-packages
kdlee@kdlee-HP-Z420-Workstation:~/.local/lib/python3.6/site-packages$  rm -rf ssp*
kdlee@kdlee-HP-Z420-Workstation:~/.local/lib/python3.6/site-packages$ cd /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package
kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ python3 -m pip install -r requirements.txt . --user
Processing /home/kdlee/work/riscv/chipsalliance/Cores-SweRV-Support-Package
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-mubpbg2k-build/setup.py", line 3, in <module>
        import ssp
    ModuleNotFoundError: No module named 'ssp'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-mubpbg2k-build/
kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ 
Codasip commented 3 years ago

The problem of missing module during the installation is fixed now. Please make a pull to update the Cores-SweRV-Support-Package repository and redo the commands as you had done.

kidonglee commented 3 years ago

The problem of missing module during the installation is fixed now. Please make a pull to update the Cores-SweRV-Support-Package repository and redo the commands as you had done.

After pulling git again, the problem related to installing ssp module is solved. Thank you very much.

However, I have another problem with running ssp. When I ran ssp with modified ssp.yaml (see below), I got some error messages. And there was no available module in ssp.

I am sorry but please check it again.

[ssp.yaml modification based on original git]

      // except below, other lines are same as original git
      - name: kdlee
        uid: 1000
        gid: 1000
        groups:
             - 4
             - 24
             - 27
             - 30
             - 46
             - 116
             - 126
             - 132

[running ssp] when I ran ssp (ssp run -X), I got following messages.

WARNING: No swap limit support
2020-10-26 10:18:15,558 INFO [root]: Generating Dockerfile.
2020-10-26 10:18:15,559 INFO [root]: Generating context for Docker build
2020-10-26 10:18:15,559 INFO [root]: Generating Dockerfile
2020-10-26 10:18:15,560 INFO [root]: Building Docker image
Sending build context to Docker daemon   2.56kB
Step 1/10 : FROM ssp-docker-registry.codasip.com/free/distrib-ssp-seh1-free:latest
 ---> a53f74e7a68f
Step 2/10 : USER root
 ---> Using cache
 ---> 1a5ca6fb866f
Step 3/10 : RUN set -eux && getent group kdlee || groupadd -f kdlee -g 1000     && useradd --create-home --no-log-init -u 1000 -g 1000 kdlee     && echo 'kdlee:kdlee' | chpasswd     && echo 'export MODULEPATH=/prj/ssp/modules' >> /home/kdlee/.bashrc     && usermod -aG 4,24,27,30,46,116,126,132 kdlee     && echo 'kdlee ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
 ---> Running in 694a30f37edf
+ getent group kdlee
+ groupadd -f kdlee -g 1000
+ useradd --create-home --no-log-init -u 1000 -g 1000 kdlee
useradd: UID 1000 is not unique
The command '/bin/sh -c set -eux && getent group kdlee || groupadd -f kdlee -g 1000     && useradd --create-home --no-log-init -u 1000 -g 1000 kdlee     && echo 'kdlee:kdlee' | chpasswd     && echo 'export MODULEPATH=/prj/ssp/modules' >> /home/kdlee/.bashrc     && usermod -aG 4,24,27,30,46,116,126,132 kdlee     && echo 'kdlee ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers' returned a non-zero code: 4
Traceback (most recent call last):
  File "/home/kdlee/.local/bin/ssp", line 11, in <module>
    sys.exit(ssp())
  File "/home/kdlee/.local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/kdlee/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/kdlee/.local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/kdlee/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/kdlee/.local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/cli/__init__.py", line 27, in run
    launcher.run(sshx, dry_run, skip_config)
  File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/launcher.py", line 53, in test_docker_installation
    return function(*args, **kwargs)
  File "/home/kdlee/.local/lib/python3.6/site-packages/ssp/launcher.py", line 190, in run
    '-t', self.config['new_image']], check=True)
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['docker', 'build', '/home/kdlee/tmp', '-t', 'custom-ssp']' returned non-zero exit status 4.

[no mudule available] There are no module available in ssp

kdlee@kdlee-HP-Z420-Workstation:~/work/riscv/chipsalliance/Cores-SweRV-Support-Package$ docker start -a -i ssp_my
[sspuser@ssp_my ~]$ module avail
[sspuser@ssp_my ~]$
tenondra commented 3 years ago

Hi, this seems to be with our docker setup. We have docker user with uid 1000 and guid 1000. So for now, I suggest you changing you UID and GID to 1001 or some other value. We will change this in the next update, so that 1000 will not be reserved uid/gid.

Also, there seems to be missing group definitions. You need to add your groups to the groups tab, for example like this:

    group0: 24
    group1: 27
    group2: 30
    group3: 46
    group4: 116
    group5: 126
    group6: 132

Also also, there seems to be some issue with one of the packages included in the basic docker image, so I suggest you running the ssp command with --skip-config option, ssp run -x --skip-config

Hope that helps.

kidonglee commented 3 years ago

Hi, this seems to be with our docker setup. We have docker user with uid 1000 and guid 1000. So for now, I suggest you changing you UID and GID to 1001 or some other value. We will change this in the next update, so that 1000 will not be reserved uid/gid.

Also, there seems to be missing group definitions. You need to add your groups to the groups tab, for example like this:

    group0: 24
    group1: 27
    group2: 30
    group3: 46
    group4: 116
    group5: 126
    group6: 132

Also also, there seems to be some issue with one of the packages included in the basic docker image, so I suggest you running the ssp command with --skip-config option, ssp run -x --skip-config

Hope that helps.

Dear tenondra,

I appreciate for your kind advice. I will try it and let you know the results.

BTW, as for 'group definitions', do I have to modify ssp.yaml ,as below?

[from]
      - name: kdlee
        uid: 1000
        gid: 1000
        groups:
             - 4
             - 24
             - 27
             - 30
             - 46
             - 116
             - 126
             - 132
[to]
      - name: kdlee
        uid: 1001
        gid: 1001
        group0: 24
        group1: 27
        group2: 30
        group3: 46
        group4: 116
        group5: 126
        group6: 132

Please check if it is OK.

Thank you.

kidonglee commented 3 years ago

Hi, this seems to be with our docker setup. We have docker user with uid 1000 and guid 1000. So for now, I suggest you changing you UID and GID to 1001 or some other value. We will change this in the next update, so that 1000 will not be reserved uid/gid.

Also, there seems to be missing group definitions. You need to add your groups to the groups tab, for example like this:

    group0: 24
    group1: 27
    group2: 30
    group3: 46
    group4: 116
    group5: 126
    group6: 132

Also also, there seems to be some issue with one of the packages included in the basic docker image, so I suggest you running the ssp command with --skip-config option, ssp run -x --skip-config

Hope that helps.

I create new account and group (UID=1001, GID=1001). And tried again with new account but it is failed also, as follow.

[ssp run]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ ssp run
WARNING: No swap limit support
2020-10-27 09:24:29,046 ERROR [root]: Current user is not in ssp.yaml. Create entry and try again.

[ssp run -x --skip-config]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ ssp run -x --skip-config
WARNING: No swap limit support
2020-10-27 09:13:10,002 ERROR [root]: Current user is not in ssp.yaml. Create entry and try again.

Thanks.

tenondra commented 3 years ago

Hello kidonglee, the structure for you should be as follows:

groups:
    group0: 24
    group1: 27
    group2: 30
    group3: 46
    group4: 116
    group5: 126
    group6: 132

# List of user accounts which shall be created in customized docker container. 
# Each of items shall contain user's login name, uid, gid, additional groups and optional shell selection 
users:
    # - name: username
    #   uid: uid_number
    #   gid: gid_number
    #   groups:
    #       - gid
    #       - gid

    - name: kdlee
        uid: 1001
        gid: 1001
        groups:
            - 4
            - 24
            - 27
            - 30
            - 46
            - 116
            - 126
            - 132

You need to manually define all the groups in the groups section. Also your username should match name of one user defined in yml file. Hope this cleared thing for you.

Codasip commented 3 years ago

Hi, this seems to be with our docker setup. We have docker user with uid 1000 and guid 1000. So for now, I suggest you changing you UID and GID to 1001 or some other value. We will change this in the next update, so that 1000 will not be reserved uid/gid. Also, there seems to be missing group definitions. You need to add your groups to the groups tab, for example like this:

    group0: 24
    group1: 27
    group2: 30
    group3: 46
    group4: 116
    group5: 126
    group6: 132

Also also, there seems to be some issue with one of the packages included in the basic docker image, so I suggest you running the ssp command with --skip-config option, ssp run -x --skip-config Hope that helps.

I create new account and group (UID=1001, GID=1001). And tried again with new account but it is failed also, as follow.

[ssp run]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ ssp run
WARNING: No swap limit support
2020-10-27 09:24:29,046 ERROR [root]: Current user is not in ssp.yaml. Create entry and try again.

[ssp run -x --skip-config]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ ssp run -x --skip-config
WARNING: No swap limit support
2020-10-27 09:13:10,002 ERROR [root]: Current user is not in ssp.yaml. Create entry and try again.

Thanks.

You have to be a user with e.g. johnd, UID==1001 GID=1001 and use the same in ssp.yaml to have it run properly. FYI - ssp run script is downloading base SSP docker image, customizing it based on ssp.yaml, checking who you are and starting the docker container where you are set as a user in the docker run .... cmd. You can bypass the flow if you wish . Please check the README.md where are described different ways how to start and how to run and manage SSP container including examples.

kidonglee commented 3 years ago

Hi, this seems to be with our docker setup. We have docker user with uid 1000 and guid 1000. So for now, I suggest you changing you UID and GID to 1001 or some other value. We will change this in the next update, so that 1000 will not be reserved uid/gid. Also, there seems to be missing group definitions. You need to add your groups to the groups tab, for example like this:

    group0: 24
    group1: 27
    group2: 30
    group3: 46
    group4: 116
    group5: 126
    group6: 132

Also also, there seems to be some issue with one of the packages included in the basic docker image, so I suggest you running the ssp command with --skip-config option, ssp run -x --skip-config Hope that helps.

I create new account and group (UID=1001, GID=1001). And tried again with new account but it is failed also, as follow. [ssp run]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ ssp run
WARNING: No swap limit support
2020-10-27 09:24:29,046 ERROR [root]: Current user is not in ssp.yaml. Create entry and try again.

[ssp run -x --skip-config]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ ssp run -x --skip-config
WARNING: No swap limit support
2020-10-27 09:13:10,002 ERROR [root]: Current user is not in ssp.yaml. Create entry and try again.

Thanks.

You have to be a user with e.g. johnd, UID==1001 GID=1001 and use the same in ssp.yaml to have it run properly. FYI - ssp run script is downloading base SSP docker image, customizing it based on ssp.yaml, checking who you are and starting the docker container where you are set as a user in the docker run .... cmd. You can bypass the flow if you wish . Please check the README.md where are described different ways how to start and how to run and manage SSP container including examples.

Dear Codasip and tenondra,

Thanks to your help, I made a little progress. But, I got another problem. Actually, I can see the 'docker' group from the results of 'id' command. The 'ssp run' command outputs the error message which says 'can not find docker group'. Please check the below.

Thank you very much.

[my ssp.yaml (w/o commented lines)]

from_image: "ssp-docker-registry.codasip.com/free/distrib-ssp-seh1-free:latest"
new_image: "custom-ssp"
drives:
symlinks:
groups:
users:
      - name: test
        uid: 1001
        gid: 1001
        groups:
            test: 1001
            docker: 132
export:
    - CPM_ALWAYS_CONFIGURE=True
    - PATH=$PATH:/prj/ssp/common/bin

['id' command results ]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ id
uid=1001(test) gid=1001(test) groups=1001(test),132(docker)

[run command] ssp run --skip-config

[error message]

WARNING: No swap limit support
2020-10-30 10:54:34,454 INFO [root]: Generating Dockerfile.
2020-10-30 10:54:34,455 INFO [root]: Generating context for Docker build
2020-10-30 10:54:34,455 INFO [root]: Generating Dockerfile
2020-10-30 10:54:34,455 INFO [root]: Building Docker image
Sending build context to Docker daemon   2.56kB

Step 1/10 : FROM ssp-docker-registry.codasip.com/free/distrib-ssp-seh1-free:latest
 ---> a53f74e7a68f
Step 2/10 : USER root
 ---> Using cache
 ---> 1a5ca6fb866f
Step 3/10 : RUN set -eux && getent group test || groupadd -f test -g 1001     && useradd --create-home --no-log-init -u 1001 -g 1001 test     && echo 'test:test' | chpasswd     && echo 'export MODULEPATH=/prj/ssp/modules' >> /home/test/.bashrc     && usermod -aG test,docker test     && echo 'test ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

 ---> Running in 8781eca284ed
+ getent group test
+ groupadd -f test -g 1001
+ useradd --create-home --no-log-init -u 1001 -g 1001 test
+ echo test:test
+ chpasswd
+ echo 'export MODULEPATH=/prj/ssp/modules'
+ usermod -aG test,docker test
usermod: group 'docker' does not exist
The command '/bin/sh -c set -eux && getent group test || groupadd -f test -g 1001     && useradd --create-home --no-log-init -u 1001 -g 1001 test     && echo 'test:test' | chpasswd     && echo 'export MODULEPATH=/prj/ssp/modules' >> /home/test/.bashrc     && usermod -aG test,docker test     && echo 'test ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers' returned a non-zero code: 6
Traceback (most recent call last):
  File "/home/test/.local/bin/ssp", line 11, in <module>
    sys.exit(ssp())
  File "/home/test/.local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/test/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/test/.local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/test/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/test/.local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/test/.local/lib/python3.6/site-packages/ssp/cli/__init__.py", line 27, in run
    launcher.run(sshx, dry_run, skip_config)
  File "/home/test/.local/lib/python3.6/site-packages/ssp/launcher.py", line 53, in test_docker_installation
    return function(*args, **kwargs)
  File "/home/test/.local/lib/python3.6/site-packages/ssp/launcher.py", line 190, in run
    '-t', self.config['new_image']], check=True)
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['docker', 'build', '/home/test/tmp', '-t', 'custom-ssp']' returned non-zero exit status 6.
Codasip commented 3 years ago

You have to define docker group before you add an user who shall be assigned to this group. In your particular case please update groups: section in your ssp.yaml as follows: groups:

groupname: gid

docker: 132

Note: There is no docker client within SSP container. From that point of view it has probably no sense to have a docker group there. On the other hand if you want to use SSP together with the FPGA board to run your benchmarks or benchmarks available in SSP, you should add your SSP docker user rather to groups 18 and/or 20 depending which group (GID) is "dialout" (assigned to serial communication) on your host. Please check README.md for more details.

kidonglee commented 3 years ago

nding which group (G

I already added the docker group and added user(test) to the group.

sudo groupadd docker
sudo usermod -aG docker test

You can see the result on the below 'id' command log,

['id' command results ]

test@kdlee-HP-Z420-Workstation:~/work/riscv/Cores-SweRV-Support-Package$ id
uid=1001(test) gid=1001(test) groups=1001(test),132(docker)

Please check if there is any other points that I missed.

Thank you very much.

Codasip commented 3 years ago

You have a docker group defined on your host, but there is no docker group GID==132 in SSP docker engine, which can be seen as a virtual machine having its own lightweight linux operating system. Using ssp run with ssp.yaml you are adding your user and groups in SSP docker container for seamless integration in your host and work environment. You can define any group you need, but you need not do it. For now please update the group section as proposed by me in previous answer and use "ssp run -X" to get the ssp docker container up. More detailed explanation can be found in README.md

kidonglee commented 3 years ago

You have a docker group defined on your host, but there is no docker group GID==132 in SSP docker engine, which can be seen as a virtual machine having its own lightweight linux operating system. Using ssp run with ssp.yaml you are adding your user and groups in SSP docker container for seamless integration in your host and work environment. You can define any group you need, but you need not do it. For now please update the group section as proposed by me in previous answer and use "ssp run -X" to get the ssp docker container up. More detailed explanation can be found in README.md

Dear Codasip,

According to your advice, I commented out 'docker : 123' in ssp.yaml, as below. Finally, I can run ssp with 'ssp run -X'. And, I can make connection to ssp docker container via 'ssh sspuser@172.17.0.2' However, when I run 'fusesoc run --target=sim codasip::swervolf', I got error messages, as below. How can I solve this problem? I beg your advice.

Thanks.

[modified ssp.yaml]

      - name: test
        uid: 1001
        gid: 1001
        groups:
            test: 1001
            # docker: 132  # comment out this line
export:
    # - ENV_VARIABLE=True
    # - PROGRAM_VERSION=1.2.3
    - CPM_ALWAYS_CONFIGURE=True
    - PATH=$PATH:/prj/ssp/common/bin
    - MGEN_XILINX_VIVADO_INSTALLDIR=/eda/linux/xilinx/vivado_2017.4
    - MGEN_XILINX_VIVADO_VERSION=2017.4
    - MGEN_GNU_TOOLCHAIN_INSTALLDIR=/eda/linux/gnu/7.3.1
    - MGEN_GNU_TOOLCHAIN_VERSION=7.3.1

[fusesoc error message] ERROR: 'codasip::swervolf' or any of its dependencies requires 'swervolf', but this core was not found

Codasip commented 3 years ago

This is because we are using the name with ssp prefix to prevent any name conflict with original swervolf. Please use:

fusesoc run --target=sim codasip::ssp_swervolf instead and your Verilator simulation will run as expected. Note that there is a comprehensive SPP documentation in /prj/ssp/doc where you can find more details for e.g. running benchmarks etc.

FYI - You can check all available cores using: fusesoc list-cores . . :swervolf:litedram:0 : local codasip::seh1_verilator_sim:1.0 : local codasip::seh2_verilator_sim:0 : local codasip::sel2_verilator_sim:0 : local codasip::ssp_seh1:1.8 : local codasip::ssp_seh1_tb:1.8 : local codasip::ssp_seh2:0 : local codasip::ssp_seh2_tb:0 : local codasip::ssp_sel2:0 : local codasip::ssp_sel2_tb:0 : local codasip::ssp_swervolf:0.6 : local . .

kidonglee commented 3 years ago

This is because we are using the name with ssp prefix to prevent any name conflict with original swervolf. Please use:

fusesoc run --target=sim codasip::ssp_swervolf instead and your Verilator simulation will run as expected. Note that there is a comprehensive SPP documentation in /prj/ssp/doc where you can find more details for e.g. running benchmarks etc.

FYI - You can check all available cores using: fusesoc list-cores . . :swervolf:litedram:0 : local codasip::seh1_verilator_sim:1.0 : local codasip::seh2_verilator_sim:0 : local codasip::sel2_verilator_sim:0 : local codasip::ssp_seh1:1.8 : local codasip::ssp_seh1_tb:1.8 : local codasip::ssp_seh2:0 : local codasip::ssp_seh2_tb:0 : local codasip::ssp_sel2:0 : local codasip::ssp_sel2_tb:0 : local codasip::ssp_swervolf:0.6 : local . .

Dear Codasip,

When running 'fusesoc list-cores', I got following messages.

[sspuser@3bc0889ed936 swervolf]$ fusesoc list-cores

Available cores:

Core                                     Cache status
================================================================================
:swervolf:litedram:0                   : local
fusesoc:utils:generators:0.1.4         : local
pulp-platform.org::axi_node:1.1.1-r5   : local
pulp-platform.org::common_cells:1.11.0 : local

Could you please let me know the next step ?

Thank you.

Codasip commented 3 years ago

Well, you have started ssp run -X where you have used ssp.yaml with your login name. Having that you got a SSP docker container prompt where you are logged in as you, however from your listing I see that you are logged in as a sspuser.

Ok, the reason is that you do not have set fusesoc search path properly. You can check your search path using:

fusesoc list-paths in your case it shows just /prj/ssp/soc/swervolf/cores

You need a fusesoc.conf file with following content either where you are, or in your home dir in ./.config/fusesoc/fusesoc.conf (I strongly recommend to have it in your home dir):

[library.codasip-ip] location = /prj/ssp/ip sync-uri = /prj/ssp/ip sync-type = local auto-sync = true

[library.codasip-soc] location = /prj/ssp/soc sync-uri = /prj/ssp/soc sync-type = local auto-sync = true

Configuration above instructs fusesoc to search in specified directories and in the tree bellow for *.core files containing fusesoc specific configuration for each of cores. If you look under your login in your home dir, you will find the fusesoc.conf there as described. We recommend to have this fusesoc.conf in your home as described and add your design specific search path to your work directory using:

fusesoc library add check: fusesoc library add --help

Summary: Copy fusesoc.conf to your home dir in SSP docker container to .config/fusesoc/ Check fusesoc path

fusesoc list-paths Check available cores fusesoc list-cores Run your Verilator simulation as needed: fusesoc run --target=sim codasip::ssp_swervolf

kidonglee commented 3 years ago

Dear Codasip,

Finally, I did it. I totally misunderstand how to write the ssp.yaml file. I didn't know that all 'users & groups' in ssp.yaml mean the 'users & groups' that need to be created newly in the docker container virtual machine.

I changed the ssp.yaml file as below. And, I can see that the 'fusesoc sim. + openocd + telnet debug' operation works well. Thank you very very very much.

BTW, I have one more question. Is it possible to install new tools into docker container virtual machine ? I tried 'sudo apt-get install ...', but it doesn't work. If possible, please let me know how to do it.

Thanks again.

[ssp.yaml]

from_image: "ssp-docker-registry.codasip.com/free/distrib-ssp-seh1-free:latest"
new_image: "custom-ssp"
drives:
symlinks:
groups:
    test: 1001
    docker: 132
users:
      - name: test
        uid: 1001
        gid: 1001
        groups:
            test: 1001
            docker: 132
export:
    - CPM_ALWAYS_CONFIGURE=True
    - PATH=$PATH:/prj/ssp/common/bin
    - MGEN_XILINX_VIVADO_INSTALLDIR=/eda/linux/xilinx/vivado_2017.4
    - MGEN_XILINX_VIVADO_VERSION=2017.4
    - MGEN_GNU_TOOLCHAIN_INSTALLDIR=/eda/linux/gnu/7.3.1
    - MGEN_GNU_TOOLCHAIN_VERSION=7.3.1
Codasip commented 3 years ago

It is good to hear that everything works fine for you now.

To your questions: Yes, it is possible to install additional system packages to SSP docker container. There are 2 things you have to do:

  1. Add user test to group wheel in your ssp.yaml and do "ssp run -X" to have sudo available for user test: users:

    • name: test uid: 1001 gid: 1001 groups:
      • 1001
      • 132
      • 10
  2. As SSP docker container is CentOS7 based, you have to use yum install instead of apt. Check e.g.: $ yum --help

Note: Check README.md for detailed description how to save your docker image containing all installation changes you have done. Of course in case you want to save it.