Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Commits
4b6bf3b2
Commit
4b6bf3b2
authored
4 years ago
by
Jacob Wahlman
Browse files
Options
Downloads
Plain Diff
merge w/ develop
parents
4b0087b5
79c5a170
No related branches found
Branches containing commit
No related tags found
1 merge request
!61
Fixed save/load, sfg creating, simulation, bug fixes
Pipeline
#16250
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/simulation/compile.cpp
+2
-2
2 additions, 2 deletions
src/simulation/compile.cpp
src/simulation/run.cpp
+1
-1
1 addition, 1 deletion
src/simulation/run.cpp
test/test_fast_simulation.py
+6
-0
6 additions, 0 deletions
test/test_fast_simulation.py
with
9 additions
and
3 deletions
src/simulation/compile.cpp
+
2
−
2
View file @
4b6bf3b2
...
...
@@ -204,8 +204,8 @@ private:
if
(
bits
>
64
)
{
throw
py
::
value_error
{
"Cannot truncate to more than 64 bits"
};
}
this
->
add_instruction
(
instruction_type
::
truncate
,
no_result_index
,
0
).
bit_mask
=
static_cast
<
std
::
int64_t
>
(
std
::
int64_t
{
1
}
<<
bits
);
this
->
add_instruction
(
instruction_type
::
truncate
,
no_result_index
,
0
).
bit_mask
=
static_cast
<
std
::
int64_t
>
(
(
std
::
int64_t
{
1
}
<<
bits
)
-
1
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/simulation/run.cpp
+
1
−
1
View file @
4b6bf3b2
...
...
@@ -31,7 +31,7 @@ namespace asic {
if
(
*
bits_override
>
64
)
{
throw
py
::
value_error
{
"Cannot truncate to more than 64 bits"
};
}
return
static_cast
<
std
::
int64_t
>
(
std
::
int64_t
{
1
}
<<
*
bits_override
);
// Return the bit mask override to use.
return
static_cast
<
std
::
int64_t
>
(
(
std
::
int64_t
{
1
}
<<
*
bits_override
)
-
1
)
;
// Return the bit mask override to use.
}
bits_override
.
reset
();
// Don't use bits_override if truncate is false.
return
std
::
int64_t
{};
...
...
This diff is collapsed.
Click to expand it.
test/test_fast_simulation.py
+
6
−
0
View file @
4b6bf3b2
...
...
@@ -122,6 +122,12 @@ class TestRunFor:
assert
simulation
.
results
[
"
0
"
][
4
]
==
-
6
assert
simulation
.
results
[
"
0
"
][
5
]
==
7
def
test_find_result_key
(
self
,
precedence_sfg_delays
):
sim
=
FastSimulation
(
precedence_sfg_delays
,
[[
0
,
4
,
542
,
42
,
31.314
,
534.123
,
-
453415
,
5431
]])
sim
.
run
()
assert
sim
.
results
[
precedence_sfg_delays
.
find_result_keys_by_name
(
"
ADD2
"
)[
0
]][
4
]
==
31220
assert
sim
.
results
[
precedence_sfg_delays
.
find_result_keys_by_name
(
"
A1
"
)[
0
]][
2
]
==
80
class
TestRun
:
def
test_save_results
(
self
,
sfg_two_inputs_two_outputs
):
simulation
=
FastSimulation
(
sfg_two_inputs_two_outputs
,
[
2
,
3
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment