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

Adds signed integers to DLA #27

Merged
merged 3 commits into from
May 16, 2024

Conversation

vilukissa68
Copy link
Collaborator

  • Adds support for 8-bit signed integers to driver and VP
  • Removes support for unsigned integers (u8) since those turned out not to be supported by the hardware
  • Fixes signed clipping bounds
  • Fixes PP clipping being dependant on ReLU

@vilukissa68 vilukissa68 changed the title Adds support for signed integers Adds signed integers to DLA May 14, 2024
Copy link
Contributor

@hegza hegza left a comment

Choose a reason for hiding this comment

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

Possibly incorrect random generation going on.

vp/devel/python_peripherals/DLA.py Show resolved Hide resolved
//sprintln!("\nWrite to bank {:#x}, data: {:?}", offset, buf);
for (i, b) in buf.iter().enumerate() {
unsafe { ptr::write_volatile((MEMORY_BANK_BASE_ADDR + offset + i) as *mut u8, *b) };
unsafe { ptr::write_volatile((MEMORY_BANK_BASE_ADDR + offset + i) as *mut i8, *b) };
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to elide the type in these assignments, if types are obvious from context, e.g. write_volatile(ADDR as *mut _, value). Say, you have a function like write_u8(), there is no need to re-specify the type in the implementation. This might come down to preference at the end of the day.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed explicit type assignments.

Comment on lines 119 to 120
let output: Vec<i8> = dla.read_output(output_width as usize * output_height as usize);
output
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: return expression dla.read_output(output_width as usize * output_height as usize) without the extra assignment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed this

@vilukissa68 vilukissa68 requested a review from hegza May 16, 2024 06:04
Copy link
Contributor

@hegza hegza left a comment

Choose a reason for hiding this comment

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

I think it's all good here.

* Adds support for 8-bit signed integers to driver and VP
* Removes support for unsigned integers (u8) since those turned out not
to be supported by the hardware
* Fixes signed clipping bounds
* Fixes PP clipping being dependant on ReLU
@vilukissa68 vilukissa68 force-pushed the feat/signed-integers branch from 0577693 to 07c802b Compare May 16, 2024 11:24
@vilukissa68 vilukissa68 merged commit 930b77c into soc-hub-fi:main May 16, 2024
3 checks passed
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.

2 participants