Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simuDAtor
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
simuDAtor
Merge requests
!12
MIA processor now halts on the correct clock cycle
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
MIA processor now halts on the correct clock cycle
mia_halt
into
main
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Johannes Kung
requested to merge
mia_halt
into
main
11 months ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
Closes
#35 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
acba23a4
1 commit,
11 months ago
2 files
+
20
−
14
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/simudator/processor/mia/modules/micro_memory.py
+
20
−
5
Options
@@ -134,10 +134,6 @@ class MicroMemory(Module):
micro controller sets control signals to other modules in accordance
with the micro instruction pointed to.
"""
# Always set HALT to False so that an eventual previously signalled
# HALT is reset and execution can continue normally.
self
.
halt
=
False
instruction
=
self
.
upc_s
.
get_value
()
if
instruction
is
None
:
return
@@ -240,8 +236,27 @@ class MicroMemory(Module):
case
0b1110
:
self
.
_conditional_jump
(
self
.
o_flag_val
,
0
,
uadr_field
)
case
0b1111
:
# Halt is handled by update_register
self
.
upc_control_s
.
update_value
(
0b011
)
self
.
halt
=
True
def
update_register
(
self
)
->
None
:
"""
Signal halt when the micro memory performs a halt instruction.
Notes
-----
Although the micro memory is not a register, this override is needed to
make sure a halt instruction is signalled on the actual clock cycle
where it is
"
executed
"
. All control signals for the halt will have been
propagated at the end of the previous cycle. If the halt signalling
were to be done in update_logic, the halt would erroneously be signaled
one cycle to early.
"""
seq_field
=
(
self
.
memory
[
self
.
curr_instr
]
>>
7
)
&
0b1111
if
seq_field
==
0b1111
:
self
.
halt
=
True
else
:
self
.
halt
=
False
def
_conditional_jump
(
self
,
flag
,
cond_value
,
uadr
):
"""
Helper function for executing a conditional jump to the specified uadr
Loading