Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha
Commits
9a910784
Commit
9a910784
authored
Apr 16, 2013
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include/vme64x_bfm: some IRQ support (unfinished)
parent
fee1b516
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
6 deletions
+73
-6
svec_vme_buffers.svh
hdl/include/vme64x_bfm/svec_vme_buffers.svh
+13
-0
vme64x_bfm.svh
hdl/include/vme64x_bfm/vme64x_bfm.svh
+60
-6
No files found.
hdl/include/vme64x_bfm/svec_vme_buffers.svh
View file @
9a910784
...
...
@@ -67,6 +67,17 @@ module svec_vme_buffers (
pullup
(
slave
.
write_n
)
;
pulldown
(
slave
.
bbsy_n
)
;
pullup
(
slave
.
iackin_n
)
;
pullup
(
slave
.
iackout_n
)
;
genvar
i
;
generate
for
(
i
=
0
;
i
<
6
;
i
++
)
assign
slave
.
irq_n
[
i
]
=
(
VME_IRQ_n_i
[
i
]
?
1'b0
:
1'bz
)
;
endgenerate
assign
VME_RST_n_o
=
slave
.
rst_n
;
...
...
@@ -93,6 +104,8 @@ module svec_vme_buffers (
assign
slave
.
dtack_n
=
VME_DTACK_n_i
;
assign
slave
.
berr_n
=
~
VME_BERR_i
;
assign
slave
.
retry_n
=
VME_RETRY_n_i
;
assign
slave
.
iackout_n
=
VME_IACKOUT_n_i
;
endmodule
...
...
hdl/include/vme64x_bfm/vme64x_bfm.svh
View file @
9a910784
...
...
@@ -187,7 +187,7 @@ typedef enum { DONT_CARE = 'h100,
}
vme_addr_size_t
;
typedef
enum
{
SINGLE
=
'h10
,
CR_CSR
=
'h20
,
MBLT
=
'h30
,
BLT
=
'h40
,
LCK
=
'h50
,
TwoeVME
=
'h60
,
TwoeSST
=
'h70
}
vme_xfer_type_t
;
SINGLE
=
'h10
,
CR_CSR
=
'h20
,
MBLT
=
'h30
,
BLT
=
'h40
,
LCK
=
'h50
,
TwoeVME
=
'h60
,
TwoeSST
=
'h70
,
IACK
=
'h80
}
vme_xfer_type_t
;
typedef
enum
{
D08Byte0
=
'h1
,
D08Byte1
=
'h2
,
D08Byte2
=
'h3
,
D08Byte3
=
'h4
,
D16Byte01
=
'h5
,
D16Byte23
=
'h6
,
D32
=
'h7
}
vme_data_type_t
;
...
...
@@ -207,17 +207,48 @@ class CBusAccessor_VME64x extends CBusAccessor;
protected
bit
[
4
:
0
]
m_ga
;
virtual
IVME64X
.
tb
vme
;
function
new
(
virtual
IVME64X
.
tb
_
vme
)
;
vme
=
_
vme
;
m_ga
=
6'b010111
;
vme
.
q_ga
=
m_ga
;
m_ba
=
8'b10000000
;
endfunction
// new
protected
task
acknowledge_irq
(
int
level
,
ref
int
vector
)
;
`assert_wait
(
tmo_rws_bus_free
,
vme
.
dtack_n
&&
vme
.
berr_n
,
10u
s
)
release_bus
()
;
#
40
ns
;
vme
.
q_addr
[
3
:
1
]
=
level
;
vme
.
q_iackin_n
=
1'b0
;
vme
.
q_iack_n
=
1'b0
;
vme
.
q_am
=
'h29
;
#
100
ns
;
vme
.
q_as_n
=
1'b0
;
#
100
ns
;
vme
.
q_ds_n
[
0
]
=
1'b0
;
`assert_wait
(
tmo_rws_bus_idle
,
!
vme
.
dtack_n
||
!
vme
.
berr_n
,
4u
s
)
if
(
!
vme
.
berr_n
)
$
error
(
"[rw_simple_generic]: VME bus error."
)
;
vector
=
vme
.
data
;
vme
.
q_iackin_n
=
1'b1
;
vme
.
q_iack_n
=
1'b1
;
#
100
ns
;
release_bus
()
;
endtask
protected
task
set_address
(
uint64_t
addr_in
,
vme_addr_size_t
asize
,
vme_xfer_type_t
xtype
)
;
bit
[
63
:
0
]
a
=
addr_in
;
bit
[
31
:
0
]
a_out
;
const
bit
[
5
:
0
]
am_map
[
int
]
=
'
{
A32
|
CR_CSR
:
6'b101111
,
...
...
@@ -248,11 +279,11 @@ class CBusAccessor_VME64x extends CBusAccessor;
a_out
=
{
8'h0
,
~
m_ga
[
4
:
0
]
,
a
[
18
:
0
]
};
else
case
(
asize
)
A16:
a_out
=
{
16'h0
,
m_ba
[
7
:
3
]
,
a
[
10
:
2
]
,
2'b00
};
a_out
=
{
16'h0
,
a
[
15
:
2
]
,
2'b00
};
A24:
a_out
=
{
8'h0
,
m_ba
[
7
:
3
]
,
a
[
18
:
2
]
,
2'b00
};
a_out
=
{
8'h0
,
a
[
23
:
2
]
,
2'b00
};
A32:
a_out
=
{
m_ba
[
7
:
3
]
,
a
[
26
:
2
]
,
2'b00
};
a_out
=
{
a
[
31
:
2
]
,
2'b00
};
endcase
// case (xtype)
vme
.
q_addr
[
31
:
2
]
=
a_out
[
31
:
2
]
;
...
...
@@ -399,7 +430,30 @@ class CBusAccessor_VME64x extends CBusAccessor;
writem
(
aa
,
da
,
size
,
result
)
;
endtask
task
handle_irqs
(
ref
int
done
)
;
done
=
0
;
if
(
vme
.
irq_n
!=
7'h7f
)
begin
int
i
,
level
,
vector
;
for
(
i
=
6
;
i
>=
0
;
i
--
)
if
(
!
vme
.
irq_n
[
i
])
begin
level
=
i
+
1
;
break
;
end
$
display
(
"vme64x_bfm: got irq level %d"
,
level
)
;
acknowledge_irq
(
level
,
vector
)
;
$
display
(
"vme64x_bfm: vector %x"
,
vector
)
;
done
=
1
;
end
endtask
// handle_irqs
endclass
// CBusAccessor_VME64x
...
...
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