-
Notifications
You must be signed in to change notification settings - Fork 23
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
Removing cruft headers from library tests and guarding mutexes in the memory manager #711
Removing cruft headers from library tests and guarding mutexes in the memory manager #711
Conversation
I would separate out the header changes that are RISC-V agnostic and open a different PR for the hammerparrot platform |
To run upto compilation of the library files, I think we require |
@@ -166,7 +165,7 @@ int test_manycore_eva () { | |||
tgt_epa = rand() % DRAM_EPA_SIZE; // Small, but we'll deal. | |||
|
|||
tgt_x = (rand() % (dim_x - 1)) + origin_x; | |||
tgt_y = hb_mc_config_get_dram_y(config); | |||
// tgt_y = hb_mc_config_get_dram_y(config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No y coordinates required for DRAM pods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is, but it's handled in a different way. This is @mrutt92's least favorite test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test suuuuuuuuuuuxxxxxxxxxx. When it fails, 99 times out of 100 the solution is to fix the test instead of any RTL or library code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use these now with pods
static inline hb_mc_idx_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh okay.
@@ -26,7 +26,6 @@ | |||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test superseded by test_packet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? @mrutt92 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol - whoops. forgot this exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my defense, what a non-descript name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can nuke this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I get rid of it then before we merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate PR I think
Sweet, my feedback is addressed, I’ll leave the rest to @drichmond and @mrutt92 |
Can we remove the hammerparrot platform and get the header removals / additions in? |
Is that to us or @sripathi-muralitharan? |
@sripathi-muralitharan for the separation, @drichmond for the review :P |
Removed the platform makefiles and hardware. Only the header file additions and removals now remain. |
What about the argp header, and changes to .gitignore? |
I can get rid of the .gitignore |
But that's part of the platform |
Wait, you don't want any of the headers at all? |
@@ -164,7 +163,7 @@ int test_manycore_alignment() { | |||
dram_coord_y, | |||
BASE_ADDR + 1); | |||
write_data = rand(); | |||
err = hb_mc_manycore_write32(mc, &npa, &write_data); | |||
err = hb_mc_manycore_write32(mc, &npa, write_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just an outdated test? What went wrong here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hb_mc_manycore_write*
functions call the hb_mc_manycore_write
functions by passing the address of the third argument (i,e write_data here). Passing the third argument as an address, would make the call to hb_mc_manycore_write
, a pointer to a pointer. Is that the intention? If it is, I am wrong and I will revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're probably right. Just confused why this wasn't caught before. Does the test pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the test passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly because I'm still miffed :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both versions of the test (with the changes I proposed and without them) work. So, I am not sure what is the course of action of here. Keep it the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh an always passing test, that’s a classic.
Course of action is revert the change and file an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing in that directory should be in this PR |
I guess the question is if we want to use different headers for different platforms. Totally up to you, but it makes sense to me to include this header in the main library so that everything is using the same C++ codebase |
If that's the case, then the main libraries directory, or the examples directory are better places. And it should be a separate PR. |
876a554
to
9c3a94b
Compare
Yup agree with both |
9c3a94b
to
7c9f717
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good to me. I might change the name of this PR to "Removes cruft headers and macro guards mutex" and edit the description with bullets saying what it does. The current name suggests something... bigger.
I suggest having a link from the EVA code to this test as something that
needs to be updated if EVA map is changed.
…On Wed, Apr 7, 2021 at 12:45 PM mrutt92 ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In examples/library/test_manycore_eva/main.c
<#711 (comment)>
:
> @@ -166,7 +165,7 @@ int test_manycore_eva () {
tgt_epa = rand() % DRAM_EPA_SIZE; // Small, but we'll deal.
tgt_x = (rand() % (dim_x - 1)) + origin_x;
- tgt_y = hb_mc_config_get_dram_y(config);
+ // tgt_y = hb_mc_config_get_dram_y(config);
This test suuuuuuuuuuuxxxxxxxxxx. When it fails, 99 times out of 100 the
solution is to fix the test instead of any RTL or library code.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#711 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEFG5AEXWTOG3E47J276NV3THSY4XANCNFSM42H4IWOQ>
.
|
This ready to go? Possibly with new issue opening for this:
|
New issue or just a link to https://github.com/bespoke-silicon-group/bsg_manycore/blob/ci_bigblade/v/bsg_manycore_eva_to_npa.v? |
I think michael's suggestion is to add a link to the brittle test as well as the library |
#ifdef _MMAN_MUTEX_ | ||
std::mutex mMemManagerMutex; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a standard macro? Or is this something we need to define now?
There was a problem hiding this comment.
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 is a standard macro. We will need to define it separately. Is libraries.mk a good spot for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more basic switch? Like if newlib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might conflict with something in newlib. I guess, we can be safer and say if NOPARROT or something like that. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the macro how it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not standard (and doesn't conflict with anything): good
Descriptive (does exactly what the name would imply): good
Does the job: excellent
What's the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the original question was if this was a standard macro which you just confirmed it isn't. So, there is no problem.
Are there any other changes required for this PR? |
I think this fine, let's hammer this parrot! |
… memory manager (#711) * Software fixes * Add comment to update EVA tests when EVA map is changed
… memory manager (#711) * Software fixes * Add comment to update EVA tests when EVA map is changed
… memory manager (#711) * Software fixes * Add comment to update EVA tests when EVA map is changed
This PR removes cruft headers from the library tests and adds a macro guard around the use of mutexes.