Altera_Forum
Honored Contributor
13 years agoregister synthesized but not utilized?
I've used the synthesis attribute noprune to preserve a register that has no fan-out. The purpose of the register is simply used for power consumption analysis. I've created a large register - which represents a certain % of resource usage - and I'm toggling the bits to represent different amounts of switching activity.
The attribute does what its suppose to do (for example, if the size of the register is 3000, it synthesizes 3000 DFFs) - but when expanding the size from 3000 to 6000 I noticed that the power consumption is approximately the same. Looking at the RTL viewer, I can see that the 'data' register is nowhere to be found. Is it possible that the resources can be allocated to the FPGA via using the noprune attribute - but that they will not ever be used or assigned to (which is why I'm not seeing a difference in power)? Here is the code:
module trigger_test(trigger, reset, clk);
input clk;
input reset;
output reg trigger;
reg data = 3000'b0 /* synthesis noprune */;
reg counter = 16'h32; //Trigger will be set every 1000ns (1us).
always @(posedge clk) begin
if(~reset) begin
trigger <= 1'b0;
data <= 3000'b0;
counter <= 16'h32;
end
else begin
if(!counter) begin
trigger <= 1'b1; //Trigger and data will stay at these values for 20ns because they're synced with the clk.
data <= {3000 {1'b1}};
counter <= 16'h32;
end
else begin
trigger <= 1'b0;
data <= 3000'b0;
counter <= counter - 1;
end
end
end
endmodule