Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Error: Top-level design entity "bai3" is undefined

Can You help me correct this problem in this code below:

module PWM( Ton,T,clk,Output_PWM);

input clk;

output Output_PWM;

input [7:0] Ton;

input [7:0] T;

reg Output_PWM;

integer a,i;

initial

begin

a = 0;

i = 0;

end

always@( posedge clk)

begin

if(i == 99999)

begin

i = 0;

a= a +1;

if(a <= T)

begin

if(a<= Ton)

Output_PWM = 1;

else

Output_PWM = 0;

end

else

a = 0;

end

end

endmodule

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Probably your project name is "bai3" but your top level module is "PWM". Go to Assigments->Settings and go to Top level entity and select PWM. Click OK and compile again.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    add "bai3.v" to project and check if module name is "bai3" and set top module "bai3"