Changeset 90 for trunk/MultiChannelUSB/trigger.v
- Timestamp:
- Feb 27, 2010, 10:10:19 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/trigger.v
r83 r90 1 1 module trigger 2 2 ( 3 input wire cl k, reset,4 input wire data_ready,5 input wire [11:0] data, threshold,6 output wire tr igger3 input wire clock, frame, reset, 4 input wire [11:0] cfg_data, 5 input wire [11:0] trg_data, 6 output wire trg_flag 7 7 ); 8 8 9 reg int_trigger; 9 reg trg_flag_reg; 10 reg [11:0] cfg_data_reg; 11 reg [11:0] trg_data_reg; 10 12 11 always @(posedge cl k)13 always @(posedge clock) 12 14 begin 13 15 if (reset) 14 16 begin 15 int_trigger<= 1'b0;17 trg_flag_reg <= 1'b0; 16 18 end 17 else if (data_ready)19 else 18 20 begin 19 int_trigger <= (data >= threshold); 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); 20 27 end 21 28 end 22 29 23 assign tr igger = int_trigger;30 assign trg_flag = trg_flag_reg; 24 31 25 32 endmodule
Note:
See TracChangeset
for help on using the changeset viewer.