B
Ben Heard
Guest
comp.lang.verilog,
I need to detect an edge for an interrupt routine. A temperature
sensor drives a line low upon reaching a critical stage. Once the heat
source is removed, the line returns high. I would like to detect each
edge and interrupt a processor. The chain of events would be to detect
the edge going low and interrupts the processor (drives proc_int low).
The processor then clears the interrupt (returning proc_int high). When
the heat source is removed and the interrupt line returns high I want to
interrupt the processor again (drive proc_int low).
All of this is to be done in a Xilinx Coolrunner-II CPLD. Here is the
example source that I have been trying to compile.
module edgeDetect(
clock,
reset_n,
clear_int,
temp,
proc_int
);
input clock;
input reset_n;
input clear_int;
input temp;
output proc_int;
reg proc_int;
always @( posedge temp or negedge temp )
begin
proc_int <= 1'b0;
end
always @( posedge clock )
begin
if( !reset_n || clear_int )
proc_int <= 1'b1;
end
endmodule
The trouble is that the synthesis tool is unable to synthesize this
and spits back the error that a "Multi-source in Unit <edgeDetect> on
signal <proc_int> not replaced by logic[.] Signal is stuck at GND[.]"
Is there something inherently wrong with what I'm trying to do here?
Thanks,
Ben
I need to detect an edge for an interrupt routine. A temperature
sensor drives a line low upon reaching a critical stage. Once the heat
source is removed, the line returns high. I would like to detect each
edge and interrupt a processor. The chain of events would be to detect
the edge going low and interrupts the processor (drives proc_int low).
The processor then clears the interrupt (returning proc_int high). When
the heat source is removed and the interrupt line returns high I want to
interrupt the processor again (drive proc_int low).
All of this is to be done in a Xilinx Coolrunner-II CPLD. Here is the
example source that I have been trying to compile.
module edgeDetect(
clock,
reset_n,
clear_int,
temp,
proc_int
);
input clock;
input reset_n;
input clear_int;
input temp;
output proc_int;
reg proc_int;
always @( posedge temp or negedge temp )
begin
proc_int <= 1'b0;
end
always @( posedge clock )
begin
if( !reset_n || clear_int )
proc_int <= 1'b1;
end
endmodule
The trouble is that the synthesis tool is unable to synthesize this
and spits back the error that a "Multi-source in Unit <edgeDetect> on
signal <proc_int> not replaced by logic[.] Signal is stuck at GND[.]"
Is there something inherently wrong with what I'm trying to do here?
Thanks,
Ben