-
Notifications
You must be signed in to change notification settings - Fork 0
/
parity_afu.sv
63 lines (55 loc) · 1.37 KB
/
parity_afu.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import CAPI::*;
module parity_afu (
input clock,
output timebase_request,
output parity_enabled,
input JobInterfaceInput job_in,
output JobInterfaceOutput job_out,
input CommandInterfaceInput command_in,
output CommandInterfaceOutput command_out,
input BufferInterfaceInput buffer_in,
output BufferInterfaceOutput buffer_out,
input ResponseInterface response,
input MMIOInterfaceInput mmio_in,
output MMIOInterfaceOutput mmio_out);
logic jdone;
assign timebase_request = 0,
parity_enabled = 0,
job_out.yield = 0;
shift_register jdone_shift(
.clock(clock),
.in(jdone),
.out(job_out.done));
mmio mmio_handler(
.clock(clock),
.mmio_in(mmio_in),
.mmio_out(mmio_out));
parity_workelement workelement(
.clock(clock),
.enable(job_out.running),
.reset(job_out.done),
.job_in(job_in),
.command_in(command_in),
.command_out(command_out),
.buffer_in(buffer_in),
.buffer_out(buffer_out),
.response(response));
always_ff @(posedge clock) begin
if(job_in.valid) begin
case(job_in.command)
RESET: begin
$display("Reset");
job_out.running <= 0;
jdone <= 1;
end
START: begin
$display("Start");
job_out.running <= 1;
jdone <= 0;
end
endcase
end else begin
jdone <= 0;
end
end
endmodule