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

Unit test clarification #20

Open
garyz712 opened this issue Jun 24, 2024 · 12 comments
Open

Unit test clarification #20

garyz712 opened this issue Jun 24, 2024 · 12 comments

Comments

@garyz712
Copy link

Hi we are a research team from Harvard and we are trying to figure out what exactly each provided test is testing in the black parrot simulation environment (https://github.com/black-parrot/black-parrot-sim). For example, make -C black-parrot/bp_top/syn tire_kick and make -C black-parrot/bp_top/syn build.sc sim.sc COSIM_P=1
We understand that the tests above are made of many lower level unit tests. Could anyone provide some insight on what exact unit tests are included in each test case provided in a lower level? What are some other low level unit test that we can do to make sure every little piece is working well?
We really appreciate that! Thanks!

@garyz712 garyz712 reopened this Jun 24, 2024
@dpetrisko
Copy link
Collaborator

dpetrisko commented Jun 24, 2024

Hi, thanks for your interest in the project. That command runs a single test, which is by default hello world (SUITE=bp-tests PROG=hello_world).

Running different tests is covered here in the eval guide:
https://github.com/black-parrot/black-parrot/blob/master/docs/eval_guide.md#example-commands

The guide also explains how to run a testlist (run_testlist.vcs), which contain many unit tests and can be run in parallel

@garyz712
Copy link
Author

Hi, thanks for your interest in the project. That command runs a single test, which is by default hello world (SUITE=bp-tests PROG=hello_world).

Running different tests is covered here in the eval guide: https://github.com/black-parrot/black-parrot/blob/master/docs/eval_guide.md#example-commands

The guide also explains how to run a testlist (run_testlist.vcs), which contain many unit tests and can be run in parallel

Hi!
Thanks for your quick reply! I believe those tests (especially make run_testlist.sc -j 10 TESTLIST=BEEBS_TESTLIST ) in evaluation guide are only applicable after running make prep, but I only run make prep_lite to save time. Are there other unit tests I can do after running make prep_lite? Thank you!!!

@dpetrisko
Copy link
Collaborator

prog_lite (prep_lite) builds a subset of tests just to smoke test the environment. For any serious verification, I'd recommend building the rest of the free suites (riscv-tests, coremark, beebs)

https://github.com/black-parrot-sdk/black-parrot-sdk/blob/fe3852e0188d2edcc1884368534ef0e839027276/Makefile#L56

@garyz712
Copy link
Author

garyz712 commented Jun 26, 2024

prog_lite (prep_lite) builds a subset of tests just to smoke test the environment. For any serious verification, I'd recommend building the rest of the free suites (riscv-tests, coremark, beebs)

https://github.com/black-parrot-sdk/black-parrot-sdk/blob/fe3852e0188d2edcc1884368534ef0e839027276/Makefile#L56

I am running make prep inside the docker to install all necessary testing package, but it is giving me the error below in the screenshot. I don’t see errors when I was running make prep_lite. Do you know how to fix this? Should I clean and rebuild black parrot sdk? Thank you!

IMG_6380

@dpetrisko
Copy link
Collaborator

Which docker image are you using, centos or Ubuntu? I'll take a look, those should work out of box

@garyz712
Copy link
Author

garyz712 commented Jun 26, 2024

Which docker image are you using, centos or Ubuntu? I'll take a look, those should work out of box

Ubuntu I believe, I just followed the commands below and then run make prep inside black-parrot-sim. Am I missing any important steps?

Docker build

For a painless Ubuntu build, download and install Docker Desktop then run the following:

git clone https://github.com/black-parrot/black-parrot-sim.git
cd black-parrot-sim
make -C docker docker-image docker-run
make prep

@garyz712
Copy link
Author

garyz712 commented Jun 28, 2024

I clean everything and rerun the make prep, but the same issue remains. I am using a MacBook, is this going to work for Mac OS inside the docker?

@dpetrisko
Copy link
Collaborator

Hi, I just cloned anew, worked all the way through "make prep" for me. The default docker image is centos7, built and ran from scratch.

My docker version is:
Docker version 20.10.17, build 100c701

You might want to update if you're much older than that.

going to work for Mac OS inside the docker

If it is an M1/M2 macbook, it could be a rosetta issue running an x86 image on an ARM64 processor. Unfortunately, that's way beyond my debugging scope. I'd suggest running in an x86 VM instead, which I understand have better emulation capabilities.

@dpetrisko
Copy link
Collaborator

I also found this, could be some help: https://akintola-lonlon.medium.com/your-mac-m-1-docker-image-is-not-going-to-work-on-production-heres-why-f8175bc33d90

This snippet is interesting:

docker buildx build --platform linux/amd64 \
    -t <your-dockerhub-username>/<your-image-name> \
    -f Dockerfile \
    --push \
    --no-cache \

"--platform linux/amd64" could be helpful

@garyz712
Copy link
Author

garyz712 commented Jun 28, 2024

Thank you for your reply! I am using an old MacBook (not M1/2), with Docker version 26.1.1, build 4cf5afa. I think they should work,. Probably I just missed some steps. Btw, make prep_lite works for me
Let me recap all that I have done below:
"""
git clone https://github.com/black-parrot/black-parrot-sim.git
cd black-parrot-sim
pip install --user orderedmultidict
make -C docker docker-image docker-run
make prep
"""
is it because I did not install dependencies and update cmake for CentOS7+? But I couldn't do so inside the docker since I can't use sudo or apt-get in my docker container.

@dpetrisko
Copy link
Collaborator

The idea of a docker image is to work out of box, with no additional dependencies. (You do not need to pip install anything). You can see the docker image doing everything in the getting started guide here:

RUN pip3 install orderedmultidict
.

I would try in order

  1. Switching to the ubuntu docker image
  2. Running a Centos7 VM

It's possible the MacOS kernel itself incompatible with parts of the build process, in which case a VM is the
only practical way to fix it

@garyz712
Copy link
Author

Thanks for your explanation! It is surprising that CentOS image isn’t compatible with macOS. How to switch to Ubuntu docker Image on MacBook?

Is there any other developers using macOS before able to build it?

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

2 participants