65 lines
1.5 KiB
Systemverilog
65 lines
1.5 KiB
Systemverilog
module baseball_scoreboard (
|
|
input logic clock,
|
|
input logic reset,
|
|
|
|
input logic got_strike,
|
|
input logic got_ball,
|
|
input logic got_foul,
|
|
input logic got_hit,
|
|
input logic got_out,
|
|
|
|
output logic [1:0] strike_count,
|
|
output logic [2:0] ball_count,
|
|
output logic [1:0] out_count,
|
|
output logic [3:0] inning_count,
|
|
output logic team_active
|
|
);
|
|
logic [1:0] strike_mut_sel;
|
|
logic [1:0] ball_mut_sel;
|
|
logic [1:0] out_mut_sel;
|
|
logic inning_mut_sel;
|
|
logic team_toggle;
|
|
logic strikeout;
|
|
logic walk;
|
|
logic three_outs;
|
|
logic game_ended;
|
|
|
|
baseball_controlpath ctlpath (
|
|
.got_strike(got_strike),
|
|
.got_ball(got_ball),
|
|
.got_foul(got_foul),
|
|
.got_hit(got_hit),
|
|
.got_out(got_out),
|
|
.strikeout(strikeout),
|
|
.walk(walk),
|
|
.three_outs(three_outs),
|
|
.game_ended(game_ended),
|
|
.strike_count(strike_count),
|
|
.team_active(team_active),
|
|
.strike_mut_sel(strike_mut_sel),
|
|
.ball_mut_sel(ball_mut_sel),
|
|
.out_mut_sel(out_mut_sel),
|
|
.inning_mut_sel(inning_mut_sel),
|
|
.team_toggle(team_toggle)
|
|
);
|
|
|
|
baseball_datapath datapath (
|
|
.clock(clock),
|
|
.reset(reset),
|
|
.strike_mut_sel(strike_mut_sel),
|
|
.ball_mut_sel(ball_mut_sel),
|
|
.out_mut_sel(out_mut_sel),
|
|
.inning_mut_sel(inning_mut_sel),
|
|
.team_toggle(team_toggle),
|
|
.strikeout(strikeout),
|
|
.walk(walk),
|
|
.three_outs(three_outs),
|
|
.game_ended(game_ended),
|
|
.strike_count(strike_count),
|
|
.ball_count(ball_count),
|
|
.out_count(out_count),
|
|
.inning_count(inning_count),
|
|
.team_active(team_active)
|
|
);
|
|
|
|
endmodule |