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

Upstream carfield/astral features to main #87

Open
wants to merge 255 commits into
base: master
Choose a base branch
from
Open

Upstream carfield/astral features to main #87

wants to merge 255 commits into from

Conversation

belanoa
Copy link

@belanoa belanoa commented Nov 13, 2024

No description provided.

Yvan Tortorella and others added 30 commits May 11, 2023 22:42
* Fix syntax error
@alex96295 alex96295 changed the title Port astral features to master branch Upstream carfield/astral features to main Dec 4, 2024
@alex96295 alex96295 self-requested a review December 4, 2024 12:33
@alex96295
Copy link
Collaborator

alex96295 commented Dec 4, 2024

General comment for the CI:

  • It seems that the main common issue across the tests that you have is:
fatal: could not get a repository handle for submodule 'pulp-runtime'
  • There is only one test for which you can get past the error above, i.e. ParMatrixMul32. So maybe this hints at some conflicts between the parallel runs.

  • Even if the test ParMatrixMul32 starts correctly, note that it is functionally broken as it raises illegal instructions, so this is a real bug that needs to be fixed locally first -> https://iis-git.ee.ethz.ch/github-mirror/pulp_cluster/-/jobs/1499281

@alex96295 alex96295 marked this pull request as draft December 6, 2024 15:37
@belanoa belanoa marked this pull request as ready for review December 13, 2024 09:46
Comment on lines +30 to +37
riscv: { git: "https://github.com/AlSaqr-platform/riscv_nn.git", rev: astral-v1.0 }
cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: e863f576699815b38cc9d80dbdede8ed5efd5991 } # `michaero/safety-island-clic` branch
ibex: { git: "https://github.com/pulp-platform/ibex.git", rev: "pulpissimo-v6.1.2" }
scm: { git: "https://github.com/pulp-platform/scm.git", rev: 74426dee36f28ae1c02f7635cf844a0156145320 } # branch: yt/bump-clkgating
hci: { git: "https://github.com/pulp-platform/hci.git", rev: 38fc2a7 } # branch: lg/ecc_rebase_v2.1.1
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.4 }
redundancy_cells: { git: "https://github.com/pulp-platform/redundancy_cells.git", rev: 49e714b97a19a7aaddf064ae2757c8f02d1f62dc } # branch: astral-v0
redmule: { git: "https://github.com/pulp-platform/redmule.git", rev: 9223ccc } # branch: astral-hci-v2.1
Copy link
Collaborator

@alex96295 alex96295 Dec 19, 2024

Choose a reason for hiding this comment

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

It is fine to point to branches, just keep in mind that at some point these dependencies have to become releases (vx.y.x). No hurry on that side, as long as:

  • branches are preserved and nobody force-pushes
  • we keep this in mind and slowly align the various IPs

Copy link
Member

Choose a reason for hiding this comment

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

I agree. But to merge in the master, I would actually enforce pointing to version releases.

@alex96295
Copy link
Collaborator

alex96295 commented Dec 19, 2024

I gave a pass and left some comments

I suggest we:

  • Write a detailed section in the CHANGELOG to highlight what was added and fixed; for a release, we should ideally wait for all the dependencies to point to a release (stable version) instead of a branch, but we can release an alpha version
  • Improve the README with a Dependencies section. In the future, we could use online docs like in other repos (e.g. snitch cluster etc)

Copy link
Member

@FrancescoConti FrancescoConti left a comment

Choose a reason for hiding this comment

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

Hi all, I left a few comments. Some of these are cleanup and could be postponed to another PR, but given the already pretty massive size of this one I think it makes more sense to do the job cleanly already here.

Copy link
Member

Choose a reason for hiding this comment

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

do we really need this override?

Copy link
Contributor

Choose a reason for hiding this comment

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

It really depends on which core version we want to keep. As long as we stick to RISCY-NN it is not required, but I think at a certain point it would be better to merge all the features we developed into our main of CV32E40P (and I speak about features for mixed precision, redundancy, and fast IRQs, not sure if there are even others).

Copy link
Member

Choose a reason for hiding this comment

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

why .bender is removed from the .gitignore?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, @belanoa please add it back.

Comment on lines +30 to +37
riscv: { git: "https://github.com/AlSaqr-platform/riscv_nn.git", rev: astral-v1.0 }
cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: e863f576699815b38cc9d80dbdede8ed5efd5991 } # `michaero/safety-island-clic` branch
ibex: { git: "https://github.com/pulp-platform/ibex.git", rev: "pulpissimo-v6.1.2" }
scm: { git: "https://github.com/pulp-platform/scm.git", rev: 74426dee36f28ae1c02f7635cf844a0156145320 } # branch: yt/bump-clkgating
hci: { git: "https://github.com/pulp-platform/hci.git", rev: 38fc2a7 } # branch: lg/ecc_rebase_v2.1.1
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.4 }
redundancy_cells: { git: "https://github.com/pulp-platform/redundancy_cells.git", rev: 49e714b97a19a7aaddf064ae2757c8f02d1f62dc } # branch: astral-v0
redmule: { git: "https://github.com/pulp-platform/redmule.git", rev: 9223ccc } # branch: astral-hci-v2.1
Copy link
Member

Choose a reason for hiding this comment

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

I agree. But to merge in the master, I would actually enforce pointing to version releases.

Copy link
Member

Choose a reason for hiding this comment

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

This script does not export correctly the environment if not at IIS, for example on UNIBO machines. Please fix it so that it initializes to a reasonable default in this cases, e.g.,

export VLOG="$QUESTA vlog"

It would be best to also check that other variables (e.g., PULP_RUNTIME_GCC_TOOLCHAIN) are also properly set.

BTW: where are QUESTA_HOME and QUESTASIM_HOME used?

Copy link
Contributor

Choose a reason for hiding this comment

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

@belanoa you can copy this from here.

Copy link
Member

Choose a reason for hiding this comment

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

same as astral-env.sh

Copy link
Contributor

Choose a reason for hiding this comment

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

See above.

logic [1:0] s_TCDM_arb_policy;
logic tcdm_sleep;

// FIXME: iDMA
Copy link
Member

Choose a reason for hiding this comment

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

remove dead code...

logic [Cfg.NumCores-1:0] hmr_dmr_sw_resynch_req, hmr_tmr_sw_resynch_req;
logic [Cfg.NumCores-1:0] hmr_dmr_sw_synch_req, hmr_tmr_sw_synch_req;

// FIXME: iDMA
Copy link
Member

Choose a reason for hiding this comment

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

remove dead code... unless you know what this FIXME actually means

//***************************************************
//*********************DMAC WRAP*********************
//***************************************************
`ifdef TARGET_MCHAN
Copy link
Member

Choose a reason for hiding this comment

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

can we make this a parameter instead of this define?

Copy link
Contributor

Choose a reason for hiding this comment

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

See one of the comments above for the icache define. I think it is worth trying to use a parameter, but if I don't go wrong some of the code within the parameter scope was not properly handled by either the simulator or the synthesizer. We can try using a parameter of the cache selection first, and if it works, we use it also for the DMA. This said, in my opinion we should really choose for one DMA and discard the other.

end
endgenerate

`ifdef SNITCH_ICACHE
Copy link
Member

Choose a reason for hiding this comment

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

can we make this a parameter?

Copy link
Member

Choose a reason for hiding this comment

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

also: what is the default? are we sure that the Snitch I$ is faster/more efficient/... than the shared I$?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have left a comment above, unfortunately after taping out Astral I discovered the snitch cache is a bit buggy in handling the compressed instructions. The default should really be the hierarchical cache, but see other comments about parameters vs. defines I left above. I would push for trying using a parameter for the icache and, if it does not brake the simulator or the synthesizer, we can use it also for the DMAs. But I am quite sure the parameters in this case caused some issues, otherwise I cannot find any other reason for using the defines (I prefer parameters as well).

assign tcdm_slave_dec.r_id = resp_id_q;

hci_ecc_dec #(
.`HCI_SIZE_PARAM(tcdm_target) ( HCI_MEM_SIZE ),
Copy link
Member

Choose a reason for hiding this comment

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

same commeent as above on hci_helpers.svh.

@FrancescoConti
Copy link
Member

Also, @DanielKellerM @arpansur @sermazz as we discussed already please keep track of this PR

Copy link
Contributor

@yvantor yvantor left a comment

Choose a reason for hiding this comment

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

I have requested a few changes, but overall great job! Sorry for getting here so late :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, @belanoa please add it back.

Copy link
Contributor

Choose a reason for hiding this comment

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

It really depends on which core version we want to keep. As long as we stick to RISCY-NN it is not required, but I think at a certain point it would be better to merge all the features we developed into our main of CV32E40P (and I speak about features for mixed precision, redundancy, and fast IRQs, not sure if there are even others).

Comment on lines +40 to +50
cluster_icache:
revision: dd0e8f3497903a9ca99fc9f349d5a4f688ceb3ae
version: null
source:
Git: https://github.com/pulp-platform/cluster_icache.git
dependencies:
- axi
- common_cells
- register_interface
- scm
- tech_cells_generic
Copy link
Contributor

Choose a reason for hiding this comment

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

Small note now that I see this. Unfortunately, only after the Astral tapeout I figured out there is a bug with this icache handling compressed instructions. As long as someone can debug it properly I would avoit its usage (I should have added a define to discriminate between the snitch icache and the old hierarchical one).

Comment on lines -61 to +77
- target: rtl
- rtl/core_region.sv
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this for? I think we externalized the core demux from the old core region so this should no longer be required.

bender_defs += -D PRIVATE_ICACHE
bender_defs += -D HIERARCHY_ICACHE_32BIT
bender_defs += -D ICAHE_USE_FF
bender_defs += -D NO_FPU
Copy link
Contributor

Choose a reason for hiding this comment

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

Check this define, I remember the FPU selection was in the end made with a parameter, so if this define is no longer needed we can delete it.

end
endgenerate

`ifdef SNITCH_ICACHE
Copy link
Contributor

Choose a reason for hiding this comment

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

I have left a comment above, unfortunately after taping out Astral I discovered the snitch cache is a bit buggy in handling the compressed instructions. The default should really be the hierarchical cache, but see other comments about parameters vs. defines I left above. I would push for trying using a parameter for the icache and, if it does not brake the simulator or the synthesizer, we can use it also for the DMAs. But I am quite sure the parameters in this case caused some issues, otherwise I cannot find any other reason for using the defines (I prefer parameters as well).

.test_mode_i ( test_mode_i ),
// Scrubber
.scrub_trigger_i ( scrubber_trigger ),
// in the cluster control unit.
Copy link
Contributor

Choose a reason for hiding this comment

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

Put this in line.

Comment on lines +29 to +40
parameter NB_CORES = 12,
parameter NB_MPERIPHS = 1,
parameter NB_SPERIPHS = 10,
parameter ADDR_WIDTH = 32,
parameter DATA_WIDTH = 32,
parameter BE_WIDTH = 0,
parameter PE_ROUTING_LSB = 10,
parameter PE_ROUTING_MSB = 13,
parameter bit HWPE_PRESENT = 1'b1,
parameter CLUSTER_ALIAS = 1,
parameter CLUSTER_ALIAS_BASE = 12'h000,
parameter ADDREXT = 1'b0,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
parameter NB_CORES = 12,
parameter NB_MPERIPHS = 1,
parameter NB_SPERIPHS = 10,
parameter ADDR_WIDTH = 32,
parameter DATA_WIDTH = 32,
parameter BE_WIDTH = 0,
parameter PE_ROUTING_LSB = 10,
parameter PE_ROUTING_MSB = 13,
parameter bit HWPE_PRESENT = 1'b1,
parameter CLUSTER_ALIAS = 1,
parameter CLUSTER_ALIAS_BASE = 12'h000,
parameter ADDREXT = 1'b0,
parameter int unsigned NB_CORES = 12,
parameter int unsigned NB_MPERIPHS = 1,
parameter int unsigned NB_SPERIPHS = 10,
parameter int unsigned ADDR_WIDTH = 32,
parameter int unsigned DATA_WIDTH = 32,
parameter int unsigned BE_WIDTH = 0,
parameter int unsigned PE_ROUTING_LSB = 10,
parameter int unsigned PE_ROUTING_MSB = 13,
parameter bit HWPE_PRESENT = 1'b1,
parameter bit CLUSTER_ALIAS = 1,
parameter logic [11:0] CLUSTER_ALIAS_BASE = 'h000,
parameter bit ADDREXT = 1'b0,

Comment on lines +63 to +66
if (CLUSTER_ALIAS == 1)
assign cluster_alias = 1'b1;
else
assign cluster_alias = 1'b0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (CLUSTER_ALIAS == 1)
assign cluster_alias = 1'b1;
else
assign cluster_alias = 1'b0;
assign cluster_alias = CLUSTER_ALIAS;

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this file? I think having a script for automatically loading the interesting waves makes sense but this is uselessly large. Have a look at how I did it in RedMulE, it should simplify the waves script also for future changes.

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

Successfully merging this pull request may close these issues.

8 participants