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

scripts: No config rebuild #56

Merged
merged 2 commits into from
Feb 6, 2024
Merged

scripts: No config rebuild #56

merged 2 commits into from
Feb 6, 2024

Conversation

IstvanZsSzekely
Copy link
Contributor

  • Build the project first using make
  • Run the simulation only with make RUN=sim after the build is created

This is intended to be used mainly for repeated simulations, where the project or simulation files are finalized and we want to run the tests repeatedly one after another.

- Build the project first using make
- Run the simulation only with make RUN=sim after the build is created

Signed-off-by: Istvan-Zsolt Szekely <[email protected]>
@IstvanZsSzekely IstvanZsSzekely added the enhancement New feature or request label Nov 1, 2023
Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better than a RUN=sim flag is to use what we are implementing analogdevicesinc/hdl#1202 here.
Would change the library target to an array of component.xml paths, so the Makefile can properly manage the lib dependencies, re-running cfg build only when necessary.

However, resolving my review comments, I'm OK with merging this as is for now.

@@ -63,6 +63,9 @@ endif
# $(1): configuration name
define build
$(addprefix runs/,$(1)/system_project.log) : library $(addprefix cfgs/,$(1).tcl) $(ENV_DEPS)
ifeq ($(RUN), sim)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why touch system_project.log, and not only:

ifneq ($(RUN), sim)
	-rm -rf $(addprefix runs/,$(1))
	(...)
endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought about that approach to be honest, and yes, it's better.

@@ -63,6 +63,9 @@ endif
# $(1): configuration name
define build
$(addprefix runs/,$(1)/system_project.log) : library $(addprefix cfgs/,$(1).tcl) $(ENV_DEPS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(ENV_DEPS) has no effect, since the library target is not managed (no timestamp), always triggering a rebuild.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't dug deep into what is going on in the make dependencies beyond the base requirements that were set in the Makefile. When the PR was created, I found that the the library is always "remade" and it showed the make script as it was changed, forcing a rebuild. I haven't tried to find a fix for the library scripting so the configs are not rebuilt in the testbenches.

@IstvanZsSzekely
Copy link
Contributor Author

Seeing that there is an ongoing PR in the HDL repository regarding the parallel build, and potentially fixing the library targets as you mentioned, I'll put this PR on hold for the time being. Once it gets merged with the main branch, I'll do the tests with the main Testbenches branch and check if this PR is even needed at that point.

@IstvanZsSzekely IstvanZsSzekely marked this pull request as draft December 8, 2023 13:26
- Updated makefile prevents config rebuilds
- Simulation always runs

Signed-off-by: Istvan-Zsolt Szekely <[email protected]>
@IstvanZsSzekely
Copy link
Contributor Author

Removed the option for RUN=sim
Simulation always runs
Configuration is rebuilt only if configuration or library related files change

@IstvanZsSzekely IstvanZsSzekely marked this pull request as ready for review January 15, 2024 08:42
@IstvanZsSzekely IstvanZsSzekely changed the title scripts: Added option to run simulation only scripts: No config rebuild Jan 15, 2024
@gastmaier
Copy link
Contributor

gastmaier commented Feb 5, 2024

Doesn't work in parallel make -j4, I will add to my list of TODOs to examine more carefully.
Ignore this comment, I improperly tested it.

Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test condition:
Rebased to main

git rebase origin/main

Clean-all then build, with 5 processes.
Builds libraries in parallel then runs a single tb.

pulsar_adc_pmdz$ (cd ../../library/ ; make clean-all) ; make CFG=cfg1 TST=test_sleep_delay -j5

Builds libraries in parallel then runs multiple tbs in parallel.

jesd_loopback$ make  -j5

Build without cleaning.
Runs project without rebuilding cfg

pulsar_adc_pmdz$ make CFG=cfg1 TST=test_sleep_delay -j5

Touch library then build.
Rebuilds touched libraries, rebuilds cfg then runs tb.

pulsar_adc_pmdz$ touch cd ../../library/spi_engine/axi_spi_engine/axi_spi_engine.v ; \
touch cd ../../library/spi_engine/spi_engine_execution/spi_engine_execution.v ; \
make CFG=cfg1 TST=test_sleep_delay -j5

Results: The libraries are properly managed and built in parallel,
however, different tbs sharing the same cfg cannot be run in parallel as is since they share the same disk files, which vivados read/writes/locks, causing the tbs to crash.
I believe the only affected project it the pulsar, due to #53, that could be reverted.

Another PR should improve the Running test_program test print since it seems to be missing linebreaks, e.g.,

Building cfg2 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg2/system_project.log] ...Building cfg2_np12 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg2_np12/system_project.log] ...Building cfg1 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg1/system_project.log] ...Building cfg4_F8 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg4_F8/system_project.log] ...Building cfg3_np12_L2M8 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg3_np12_L2M8/system_project.log] ... OK
 OK
 OK
 OK
 OK

and resolve the issue described before.

Unrelated: the jesd_loopback cfg6_F64 is failing with error:

[ERROR] 89535 ns   Address : 0000000044a90314; Data mismatch. Read data is : 00000000; expected is 1f3f8000

@IstvanZsSzekely
Copy link
Contributor Author

Results: The libraries are properly managed and built in parallel, however, different tbs sharing the same cfg cannot be run in parallel as is since they share the same disk files, which vivados read/writes/locks, causing the tbs to crash. I believe the only affected project it the pulsar, due to #53, that could be reverted.

I did not try to run any test program in parallel, but I think that this is acceptable for now, up until we end up having a lot more test programs in one project that share configuration files and require a significant amount of time to complete. This will more than likely change the structure of the code and the way the project and results are generated.

Another PR should improve the Running test_program test print since it seems to be missing linebreaks, e.g.,

Building cfg2 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg2/system_project.log] ...Building cfg2_np12 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg2_np12/system_project.log] ...Building cfg1 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg1/system_project.log] ...Building cfg4_F8 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg4_F8/system_project.log] ...Building cfg3_np12_L2M8 env [/home/me/Documents/adi/hdl/testbenches/jesd_loopback/runs/cfg3_np12_L2M8/system_project.log] ... OK
 OK
 OK
 OK
 OK

and resolve the issue described before.

I didn't experience this issue. Is it maybe because of parallel jobs? If so, as stated before, this can be left alone for now, but this PR will be noted when a change is required.

Unrelated: the jesd_loopback cfg6_F64 is failing with error:

[ERROR] 89535 ns   Address : 0000000044a90314; Data mismatch. Read data is : 00000000; expected is 1f3f8000

This is a known issue, someone who knows the JESD infrastructure will have to take a look at it and try to figure out what changed since the last known working version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants