Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

From Java code to Verilog?

Status
Not open for further replies.

membersound

Newbie level 1
Joined
Apr 9, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
Hi,

hope I chose the right forum for my topic:
I'm trying to write a small java program that is capable of producing Verilog code. As I hardly know the Verilog language, I have problems creating a simple example.

Let's assume we have 2 inputs a, b, and 1 output c. Also 2 states. State1 is the initial state, and goes to State2 for a certain condition wire1, which requires b = 1.
My output in this example would have state2 & a as condition to be met.

Question: Using the approximate design below, how would the full Verilog code look according to my example?

Code:
//simplified without inheritance
class Input {
    String varname;
    new Input(String varname);
}

class Output {
    String varname;
    String condition;
    new Output(String varname, String condition);
}

class State {
    String varname;
    new State(String varname);
}

class Wire {
    String condition;
    Input input;
    Ouput output;
    new Wire(Input input, Output output, String condition);
}

Input input1 = new Input("a");
Input input2 = new Input("b");
State state1 = new State("initial");
State state2 = new State("following");
Wire wire12 = new Wire(state1, state2, "b");
Ouput output1 = new Output(c, "state2 & a");

How would the verilog code have to look based on this?

Code:
module BasicFsm(
    input clock,
    input reset,
    input a,
    input b,
    output c
);

always @(posedge clock)
//how to continue here?

Thanks for any help.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top