Skip to content

Printf mcs mutex#574

Open
mrutt92 wants to merge 6 commits into
masterfrom
printf_mcs_mutex
Open

Printf mcs mutex#574
mrutt92 wants to merge 6 commits into
masterfrom
printf_mcs_mutex

Conversation

@mrutt92

@mrutt92 mrutt92 commented Sep 7, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@taylor-bsg

Copy link
Copy Markdown
Contributor

is this one ready to go, max?

Comment on lines +34 to +35
extern int __bsg_pod_x; //The X Cord of the tile's pod (lives in DRAM)
extern int __bsg_pod_y; //The Y cord of the tile's pod (lives in DRAM)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could grab these values from cfg_pod CSR at the beginning. There is no need to have the host set these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess that's true. It save's a trivial few instruction words in the initialization to have the host set it. That CSR resets to the current pod but it can be set by the core to something else (like if it wants to read another pod's DRAM).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm honestly not 100% sure which is better. I think it's better to have the host set it? It's just a couple extra packets in the nbf and we don't need to entangle it with the semantics of the pod csr. But I'm not sure, I'm open to be talked down from that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it makes sense to keep these variable in DRAM, because if you change the pod x/y CSR then now you are reading those values from different pods' DRAM space. I think it's better off to make global x/y readable by CSR instructions (read-only), then it doesn't take up space in neither DRAM or DMEM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think that makes a lot of sense. That'll also decouple these values from the semantics of the pod address register.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is it necessary to access the X and Y coordinate of the pod? As a general principle we would like to avoid code that depends on this, since it is a virtualization hazard...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a global lock.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes why do we need a global lock across pods..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe we don't? If each pod has its own IO node then there's no need.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At the moment, there's only one IO node shared across pods. A global lock prevents the IO node from being slammed with packets from all pods.

@taylor-bsg

taylor-bsg commented Sep 29, 2021 via email

Copy link
Copy Markdown
Contributor

@taylor-bsg

taylor-bsg commented Sep 29, 2021 via email

Copy link
Copy Markdown
Contributor

@mrutt92

mrutt92 commented Sep 29, 2021

Copy link
Copy Markdown
Contributor Author

It prevents one IO node from being slammed and it also serves as keeping the messages from being garbled.

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.

3 participants