While i am implementing the below verilog codings in CPLD -XC9572XL device the following error has been occurred .can anyone suggest me wat can we do for implement the same kind of various processes module codings (like phase locked loop,timer,automation purpose module) in single CPLD device, i know there is not enough space to fuse below coding due to less macrocell (72 macrocell) can any one suggest me which xilinx device is opt for this process either CPLD or FPGA ? I AM USING THIS FRO INDUSTRIAL AUTOMATION PURPOSE.THANK YOU
Code Verilog - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
| module pwm_cpld(clk,sw1,sw2,pulse,dc_out,a);
//input ports
input clk;
input sw1,sw2;
//output ports
output pulse;
output dc_out;
output [3:0]a;
//............................................
//internal variables
reg pulse ;
reg[12:0]cnt1=200;
reg[7:0]cnt=10;
reg[12:0]h;
reg[20:0]f;
always @(posedge clk)
begin
h<=h+1;
if (h<cnt1)
pulse <=1'b1;
else if ((h>cnt1) && (h < 2000))
pulse <= 1'b0;
else if (h>2000)
h<=0;
end
always @ (posedge clk)
begin
if (sw1==1'b0)
begin
f<=f+1;
if(f>1000000)
begin
cnt<=cnt+1;
f <=0;
end
if(cnt>=90)
cnt<=90;
end
//................................................................
if (sw2==1'b0)
begin
f<=f+1;
if (f>1000000)
begin
cnt<=cnt-1;
f <= 0;
end
if (cnt<= 10)
cnt<=10;
end
cnt1<=cnt*20;
end
assign a =4'b0111;
assign dc_out =1'b0;
endmodule |