Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cMIPS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roberto Hexsel
cMIPS
Commits
e21ec516
Commit
e21ec516
authored
Apr 22, 2016
by
Roberto Hexsel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hw interrupts were connected to the wront IRQs
parent
92800b1d
Pipeline
#3243
skipped
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
21 deletions
+30
-21
cMIPS/include/handlers.s
cMIPS/include/handlers.s
+22
-15
cMIPS/include/start.s
cMIPS/include/start.s
+3
-3
cMIPS/tests/extCounter.c
cMIPS/tests/extCounter.c
+1
-1
cMIPS/vhdl/tb_cMIPS.vhd
cMIPS/vhdl/tb_cMIPS.vhd
+4
-2
No files found.
cMIPS/include/handlers.s
View file @
e21ec516
...
...
@@ -31,7 +31,7 @@ extCounter:
sw
$zero
,
0
(
$k0
)
#
Reset
counter
,
remove
interrupt
request
#----------------------------------
#
save
additional
registers
#
if you change this handler, then
save additional registers
#
lui
$k1
,
%
hi
(
_counter_saves
)
#
ori
$k1
,
$k1
,
%
lo
(
_counter_saves
)
#
sw
$a0
,
0
*
4
(
$k1
)
...
...
@@ -50,7 +50,7 @@ extCounter:
sw
$k1
,
0
(
$k0
)
#----------------------------------
#
and
then
restore
those
same
registers
#
if you changed this handler,
then restore those same registers
#
lui
$k1
,
%
hi
(
_counter_saves
)
#
ori
$k1
,
$k1
,
%
lo
(
_counter_saves
)
#
lw
$a0
,
0
*
4
(
$k1
)
...
...
@@ -206,11 +206,14 @@ cmips_delay:
#----------------------------------------------------------------
#
print
a
message
,
does
not
disturbs
registers
.
bss
#
print
a
message
from
within
"the kernel"
#
void
cmips_kmsg
(
$k1
)
#
this
function
preserves
registers
other
than
k0
,
k1
#
.
data
.
align
2
.
comm
_kmsg_saves
4
*
4
#
area
to
save
up
to
4
registers
#
_kmsg_saves
[
0
]=
$a0
,
[
1
]=
$a1
,
[
2
]=
$a2
,
[
3
]=
$
ra
.
comm
_kmsg_saves
4
*
4
#
area
to
save
4
registers
#
_kmsg_saves
[
0
]=
$a0
,
[
1
]=
$a1
,
[
2
]=
$a2
,
[
3
]=
$
a3
#
.
text
.
align
2
...
...
@@ -218,8 +221,8 @@ cmips_delay:
.
set
noat
.
global
cmips_kmsg
.
ent
cmips_kmsg
.
equ
stdout
_addr
,(
x_IO_BASE_ADDR
+
1
*
x_IO_ADDR_RANGE
)
;
#
void
cmips_kmsg
(
$k1
)
.
equ
stdout
,(
x_IO_BASE_ADDR
+
1
*
x_IO_ADDR_RANGE
)
;
cmips_kmsg
:
lui
$k0
,
%
hi
(
_kmsg_saves
)
ori
$k0
,
$k0
,
%
lo
(
_kmsg_saves
)
...
...
@@ -232,14 +235,15 @@ cmips_kmsg:
sll
$k1
,
$k1
,
2
#
adjust
index
onto
table
addu
$a1
,
$a1
,
$k1
lui
$a2
,
%
hi
(
stdout_addr
)
ori
$a2
,
$a2
,
%
lo
(
stdout_addr
)
lw
$a1
,
0
(
$a1
)
#
de
-
reference
pointer
lui
$a2
,
%
hi
(
stdout
)
ori
$a2
,
$a2
,
%
lo
(
stdout
)
k_for
:
lbu
$a0
,
0
(
$a1
)
sb
$a0
,
0
(
$a2
)
#
send
it
to
simulator
's stdout
bne
$a0
,
$zero
,
k_for
addiu
$a1
,
$a1
,
1
bne
$a0
,
$zero
,
k_for
sb
$a0
,
0
(
$a2
)
#
send
it
to
simulator
's stdout
lw
$a0
,
0
*
4
(
$k0
)
lw
$a1
,
1
*
4
(
$k0
)
...
...
@@ -250,12 +254,15 @@ k_for: lbu $a0, 0($a1)
.
equ
kmsg_interr
,
0
.
equ
kmsg_excep
,
1
.
data
.
align
2
.
global
_kmsg_list
_kmsg_interr
:
.
asciiz
"\n\tinterrupt\n\n"
_kmsg_excep
:
.
asciiz
"\n\texception
interrupt
\n\n"
_kmsg_excep
:
.
asciiz
"\n\texception\n\n"
.
global
_kmsg_list
.
data
.
align
2
_kmsg_list
:
.
word
_kmsg_interr
,
_kmsg_excep
#----------------------------------------------------------------
...
...
cMIPS/include/start.s
View file @
e21ec516
...
...
@@ -130,7 +130,7 @@ _excp_0100:
.
set
noreorder
.
set
noat
la
$k0
,
x_IO_BASE_ADDR
la
$k0
,
x_IO_BASE_ADDR
#
PANIC
:
SHOULD
NEVER
GET
HERE
mfc0
$k1
,
cop0_CAUSE
sw
$k1
,
0
(
$k0
)
#
print
CAUSE
,
flush
pipe
and
stop
simulation
nop
...
...
@@ -268,7 +268,7 @@ _excp_0200:
mfc0
$k1
,
cop0_STATUS
and
$k0
,
$k0
,
$k1
#
and
mask
with
IM
bits
srl
$k0
,
$k0
,
1
1
#
keep
only
3
MS
bits
of
IP
(
irq7
..5
)
srl
$k0
,
$k0
,
1
0
#
keep
only
3
MS
bits
of
IP
(
irq7
..5
)
lui
$k1
,
%
hi
(
handlers_tbl
)
#
plus
displacement
in
j
-
table
of
8
bytes
ori
$k1
,
$k1
,
%
lo
(
handlers_tbl
)
add
$k1
,
$k1
,
$k0
...
...
@@ -326,7 +326,7 @@ _excp_BFC0:
.
set
noreorder
.
set
noat
la
$k0
,
x_IO_BASE_ADDR
la
$k0
,
x_IO_BASE_ADDR
#
PANIC
:
SHOULD
NEVER
GET
HERE
mfc0
$k1
,
cop0_CAUSE
sw
$k1
,
0
(
$k0
)
#
print
CAUSE
,
flush
pipe
and
stop
simulation
nop
...
...
cMIPS/tests/extCounter.c
View file @
e21ec516
...
...
@@ -34,7 +34,7 @@ void main(void) {
increased
=
FALSE
;
}
}
while
(
(
readCounter
()
&
0x3fffffff
)
<
(
newValue
&
0x3ffffff
)
);
}
while
(
(
readCounter
()
&
0x3fffffff
)
<
(
newValue
&
0x3ffffff
f
)
);
// are we done yet?
if
(
increased
)
{
...
...
cMIPS/vhdl/tb_cMIPS.vhd
View file @
e21ec516
...
...
@@ -506,9 +506,11 @@ begin -- TB
not_waiting
<=
(
inst_wait
and
data_wait
and
sdram_wait
);
-- and io_wait);
-- Count=Compare at IRQ7, UART at IRQ6, extCounter at IRQ5
-- C=C U E 0 0 0 sw1 sw0
irq
<=
'0'
&
uart_irq
&
counter_irq
&
b"000"
;
-- uart+counter interrupts
-- irq <= b"00" & counter_irq & b"000"; -- counter interrupts
-- irq <= b"000000"; -- NO interrupt requests
irq
<=
uart_irq
&
counter_irq
&
b"0000"
;
-- uart+counter interrupts
-- irq <= counter_irq & b"00000"; -- counter interrupts
nmi
<=
'0'
;
-- input port to TB
U_CORE
:
core
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment