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

Long init strings make hal crash #546

Open
kraemv opened this issue Dec 21, 2023 · 1 comment
Open

Long init strings make hal crash #546

kraemv opened this issue Dec 21, 2023 · 1 comment
Assignees

Comments

@kraemv
Copy link

kraemv commented Dec 21, 2023

Hello everyone,
HAL can not handle setting too long init strings. When setting an init string of character length 64, hal accepts the string and crashes when selecting the respective gate.

To reproduce this:
Open a netlist that contains at least one LUT6_2 element.
Get the gate with: gate = netlist.get_gate_by_id(x);
Set a long init string with: gate.set_init_data(["1000100110001001100010011000100110001001100010011000100110001001"])
This returns true, so the init string was set.
When clicking on the gate, hal crashes.
The error message is:
[21.12.2023 14:52:41] [python] [info] Python console execute: "gate.set_init_data(["1000100110001001100010011000100110001001100010011000100110001001"])". [21.12.2023 14:52:41] [python] [info] True terminate called after throwing an instance of 'std::out_of_range' what(): stoull

I guess the best fix would be to reject INIT strings that do not meet the expected length of the specified gate. Note that the above could happen when someone tries to set the INIT string in binary representation

  • OS: Ubuntu
  • Version 20.04
  • Hal version: 4.2.0
@joern274 joern274 self-assigned this Jan 2, 2024
@joern274
Copy link
Contributor

joern274 commented Jan 2, 2024

The function above expects a hex string. However, a range check has been added to the code.

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

No branches or pull requests

2 participants