x393
1.0
FPGAcodeforElphelNC393camera
Main Page
+
Packages
Packages
+
Package Functions
All
Functions/Tasks/Always Construct
Variables
+
Design Unit List
Design Unit List
Design Units
Design Unit Hierarchy
+
Design Unit Members
+
All
1
2
3
5
7
8
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions/Tasks/Always Construct
_
a
c
e
f
g
l
p
r
s
t
w
+
Variables
1
2
3
5
7
8
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
File Members
+
All
c
d
s
u
+
Variables
c
d
s
u
•
All
Classes
Namespaces
Files
Functions
Variables
simul_axi_fifo_out.v
Go to the documentation of this file.
1
39
40
`timescale 1ns/1ps
41
42
module
simul_axi_fifo
43
#(
44
parameter
integer
WIDTH
=
64
,
// total number of output bits
45
parameter
integer
LATENCY
=
0
,
// minimal delay between inout and output ( 0 - next cycle)
46
parameter
integer
DEPTH
=
8
,
// maximal number of commands in FIFO
47
// parameter OUT_DELAY = 3.5,
48
parameter
integer
FIFO_DEPTH
=
LATENCY
+
DEPTH
+
1
49
// parameter integer DATA_2DEPTH=(1<<DATA_DEPTH)-1
50
)(
51
input
clk
,
52
input
reset
,
53
input
[
WIDTH
-
1
:
0
]
data_in
,
54
input
load
,
55
output
input_ready
,
56
output
[
WIDTH
-
1
:
0
]
data_out
,
57
output
valid
,
58
input
ready
);
59
60
reg
[
WIDTH
-
1
:
0
]
fifo
[
0
:
FIFO_DEPTH
-
1
];
61
integer
in_address
;
62
integer
out_address
;
63
integer
in_count
;
64
integer
out_count
;
65
reg
[
LATENCY
:
0
]
latency_delay_r
;
66
67
wire
out_inc
=
latency_delay
[
LATENCY
];
68
wire
input_ready_w
=
in_count
<
DEPTH
;
69
wire
load_and_ready
=
load
&
input_ready_w
;
// Masked load with input_ready 07/06/2016
70
wire
[
LATENCY
+
1
:
0
]
latency_delay
={
latency_delay_r
,
load_and_ready
};
71
72
assign
data_out
=
fifo
[
out_address
];
73
assign
valid
=
out_count
!=
0
;
74
75
assign
input_ready
=
input_ready_w
;
76
// assign out_inc={
77
78
always
@ (
posedge
clk
or
posedge
reset
)
begin
79
if
(
reset
)
latency_delay_r
<=
0
;
80
else
latency_delay_r
<=
latency_delay
[
LATENCY
:
0
];
81
82
if
(
reset
)
in_address
<=
0
;
83
else
if
(
load_and_ready
)
in_address
<= (
in_address
==(
FIFO_DEPTH
-
1
))?
0
:
in_address
+
1
;
84
85
if
(
reset
)
out_address
<=
0
;
86
else
if
(
valid
&&
ready
)
out_address
<= (
out_address
==(
FIFO_DEPTH
-
1
))?
0
:
out_address
+
1
;
87
88
if
(
reset
)
in_count
<=
0
;
89
else
if
(!(
valid
&&
ready
) &&
load_and_ready
)
in_count
<=
in_count
+
1
;
90
else
if
(
valid
&&
ready
&& !
load_and_ready
)
in_count
<=
in_count
-
1
;
91
92
if
(
reset
)
out_count
<=
0
;
93
else
if
(!(
valid
&&
ready
) &&
out_inc
)
out_count
<=
out_count
+
1
;
94
else
if
(
valid
&&
ready
&& !
out_inc
)
out_count
<=
out_count
-
1
;
95
end
96
always
@ (
posedge
clk
)
begin
97
if
(
load_and_ready
)
fifo
[
in_address
] <=
data_in
;
98
end
99
100
endmodule
simul_axi_fifo
Definition:
simul_axi_fifo_out.v:42
simul_axi_fifo.8861in_count
8861in_countinteger
Definition:
simul_axi_fifo_out.v:63
simul_axi_fifo.8858fifo
[0:FIFO_DEPTH-1] 8858fiforeg[WIDTH-1:0]
Definition:
simul_axi_fifo_out.v:60
simul_axi_fifo.8856valid
8856valid
Definition:
simul_axi_fifo_out.v:57
simul_axi_fifo.8851reset
8851reset
Definition:
simul_axi_fifo_out.v:52
simul_axi_fifo.8852data_in
[WIDTH-1:0] 8852data_in
Definition:
simul_axi_fifo_out.v:53
simul_axi_fifo.8865input_ready_w
8865input_ready_wwire
Definition:
simul_axi_fifo_out.v:68
simul_axi_fifo.8854input_ready
8854input_ready
Definition:
simul_axi_fifo_out.v:55
simul_axi_fifo.8847LATENCY
integer 8847LATENCY0
Definition:
simul_axi_fifo_out.v:45
simul_axi_fifo.8849FIFO_DEPTH
integer 8849FIFO_DEPTHLATENCY+DEPTH+1
Definition:
simul_axi_fifo_out.v:48
simul_axi_fifo.8864out_inc
8864out_incwire
Definition:
simul_axi_fifo_out.v:67
simul_axi_fifo.8859in_address
8859in_addressinteger
Definition:
simul_axi_fifo_out.v:61
simul_axi_fifo.8850clk
8850clk
Definition:
simul_axi_fifo_out.v:51
simul_axi_fifo.8866load_and_ready
8866load_and_readywire
Definition:
simul_axi_fifo_out.v:69
simul_axi_fifo.8846WIDTH
integer 8846WIDTH64
Definition:
simul_axi_fifo_out.v:44
simul_axi_fifo.8853load
8853load
Definition:
simul_axi_fifo_out.v:54
simul_axi_fifo.8862out_count
8862out_countinteger
Definition:
simul_axi_fifo_out.v:64
simul_axi_fifo.8855data_out
[WIDTH-1:0] 8855data_out
Definition:
simul_axi_fifo_out.v:56
simul_axi_fifo.8867latency_delay
8867latency_delaywire[LATENCY+1:0]
Definition:
simul_axi_fifo_out.v:70
simul_axi_fifo.8848DEPTH
integer 8848DEPTH8
Definition:
simul_axi_fifo_out.v:46
simul_axi_fifo.8860out_address
8860out_addressinteger
Definition:
simul_axi_fifo_out.v:62
simul_axi_fifo.8863latency_delay_r
8863latency_delay_rreg[LATENCY:0]
Definition:
simul_axi_fifo_out.v:65
simul_axi_fifo.8857ready
8857ready
Definition:
simul_axi_fifo_out.v:58
simulation_modules
simul_axi_fifo_out.v
Generated by
1.8.12