Last change
on this file since 136 was 90, checked in by demin, 15 years ago |
full rewrite
|
-
Property svn:executable
set to
*
|
File size:
572 bytes
|
Rev | Line | |
---|
[83] | 1 | module trigger
|
---|
| 2 | (
|
---|
[90] | 3 | input wire clock, frame, reset,
|
---|
| 4 | input wire [11:0] cfg_data,
|
---|
| 5 | input wire [11:0] trg_data,
|
---|
| 6 | output wire trg_flag
|
---|
[83] | 7 | );
|
---|
| 8 |
|
---|
[90] | 9 | reg trg_flag_reg;
|
---|
| 10 | reg [11:0] cfg_data_reg;
|
---|
| 11 | reg [11:0] trg_data_reg;
|
---|
[83] | 12 |
|
---|
[90] | 13 | always @(posedge clock)
|
---|
[83] | 14 | begin
|
---|
| 15 | if (reset)
|
---|
| 16 | begin
|
---|
[90] | 17 | trg_flag_reg <= 1'b0;
|
---|
[83] | 18 | end
|
---|
[90] | 19 | else
|
---|
[83] | 20 | begin
|
---|
[90] | 21 | if (frame)
|
---|
| 22 | begin
|
---|
| 23 | cfg_data_reg <= cfg_data;
|
---|
| 24 | trg_data_reg <= trg_data;
|
---|
| 25 | end
|
---|
| 26 | trg_flag_reg <= (trg_data_reg >= cfg_data_reg);
|
---|
[83] | 27 | end
|
---|
| 28 | end
|
---|
| 29 |
|
---|
[90] | 30 | assign trg_flag = trg_flag_reg;
|
---|
[83] | 31 |
|
---|
| 32 | endmodule
|
---|
Note:
See
TracBrowser
for help on using the repository browser.