Forum Discussion
27 Replies
- Altera_Forum
Honored Contributor
Instead of just asking for help when you don't appear to have done any work yourself, you'll get a better response it you try doing some work yourself and come back here with specific questions about your code.
- Altera_Forum
Honored Contributor
OK i will try thanks for you advice
- Altera_Forum
Honored Contributor
ok if found program cruise control is write java there any program to compiler to VHDL
package concurrency.cruise; import java.awt.*; import java.awt.event.*; import java.applet.*; public class CruiseControl extends Applet { CarSimulator car; CruiseDisplay disp; Controller control; Button engineOn; Button engineOff; Button accelerate; Button brake; Button on; Button off; Button resume; public void init() { String fixed = getParameter("fixed"); boolean isfixed = fixed!=null?fixed.equals("TRUE"):false; setLayout(new BorderLayout()); car = new CarSimulator(); add("Center",car); disp = new CruiseDisplay(); add("East",disp); control = new Controller(car,disp,isfixed); engineOn = new Button("engineOn"); engineOn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.engineOn(); control.engineOn(); } }); engineOff = new Button("engineOff"); engineOff.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.engineOff(); control.engineOff(); } }); accelerate = new Button("accelerate"); accelerate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.accelerate(); control.accelerator(); } }); brake = new Button("brake"); brake.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.brake(); control.brake(); } }); on = new Button("on"); on.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { control.on(); } }); off = new Button("off"); off.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { control.off(); } }); resume = new Button("resume"); resume.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { control.resume(); } }); Panel p1 = new Panel(); p1.setLayout(new FlowLayout()); p1.add(engineOn); p1.add(engineOff); p1.add(accelerate); p1.add(brake); p1.add(on); p1.add(off); p1.add(resume); add("South",p1); } public void stop() { car.engineOff(); //kill engine thread control.engineOff(); } } - Altera_Forum
Honored Contributor
Java andvhdl are very different languages. Java is a programming language and vhdl is a hardware description language. Conversion is a manual prices you will have to do yourself.
- Altera_Forum
Honored Contributor
i try to isolation cruise control by method Components
i have this (Error (10465): VHDL error at cruise_control.vhd(31): name "cruise_on" cannot be used because it is already used for a previously declared item) -------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY cruise_control IS PORT (cancel, accleartor, Rest, break, set, cruise_on, cruise_off : IN STD_LOGIC; setspeed: OUT STD_LOGIC); END cruise_control; ARCHITECTURE structural OF cruise_control IS COMPONENT crease_speed IS PORT (accleartor, Rest: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT increase_speed IS PORT (break, set: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT cancel1 IS PORT (cruise_off: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT cruise IS PORT (cruise_on: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; SIGNAL cruise_on: STD_LOGIC; BEGIN U1: crease_speed PORT MAP (accleartor, Rest, setspeed); U2: increase_speed PORT MAP (break, set, d, setspeed); U3: cancel1 PORT MAP (cruise_off, setspeed); U4: cruise PORT MAP (cruise_on, setspeed); END structural; --------------------------------------------------------------------------------- - Altera_Forum
Honored Contributor
You have an input called cruise_on, you can't also have a signal called cruise_on.
- Altera_Forum
Honored Contributor
have error :confused: why
(Error (10481): VHDL Use Clause error at cruise_control.vhd(3): design library "work" does not contain primary unit "my_components") (Error (10800): VHDL error at cruise_control.vhd(3): selected name in use clause is not an expanded name)LIBRARY ieee; USE ieee.std_logic_1164.all; USE work.my_components.all; ENTITY cruise_control IS PORT (cancel, accleartor, Rest, break, set, cruise_on, cruise_off : IN STD_LOGIC; setspeed: OUT STD_LOGIC); END cruise_control; ARCHITECTURE structural OF cruise_control IS COMPONENT crease_speed IS PORT (accleartor, Rest: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT increase_speed IS PORT (break, set: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT cancel1 IS PORT (cruise_off: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT cruise IS PORT (cruise_on: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; SIGNAL setspeed1 : STD_LOGIC; BEGIN U1: crease_speed PORT MAP (accleartor, Rest, setspeed); U2: increase_speed PORT MAP (break, set, setspeed); U3: cancel1 PORT MAP (cruise_off, setspeed); U4: cruise PORT MAP (cruise_on, setspeed); END structural; - Altera_Forum
Honored Contributor
You haven't included the my_components package. But if you have all the components declared in the code, why do you need a components package?
- Altera_Forum
Honored Contributor
I deleted ( USE work.my_components.all;) but have problem what i should to do
---------------------------------------------------------- Error: Node instance "U1" instantiates undefined entity "crease_speed" Error: Node instance "U2" instantiates undefined entity "increase_speed" Error: Node instance "U3" instantiates undefined entity "cancel1" Error: Node instance "U4" instantiates undefined entity "cruise" Error: Quartus II Analysis & Synthesis was unsuccessful. 4 errors, 0 warnings Error: Quartus II Full Compilation was unsuccessful. 6 errors, 0 warnings - Altera_Forum
Honored Contributor
You didn't include the source code for the components in your project