Line 40... |
Line 40... |
//// from http://www.opencores.org/lgpl.shtml ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// ////
|
//// ////
|
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
|
|
`include "timescale.v"
|
`include "timescale.v"
|
`include "T6507LP_ALU.v"
|
`include "t6507lp_alu.v"
|
|
|
module t6507lp_alu_wrapper();
|
module t6507lp_alu_wrapper();
|
parameter [3:0] DATA_SIZE = 4'd8;
|
parameter [3:0] DATA_SIZE = 4'd8;
|
localparam [3:0] DATA_SIZE_ = DATA_SIZE - 4'b0001;
|
localparam [3:0] DATA_SIZE_ = DATA_SIZE - 4'b0001;
|
|
|
// all inputs are regs
|
// all inputs are regs
|
reg clk;
|
reg clk;
|
reg reset_n;
|
wire reset_n;
|
reg alu_enable;
|
wire alu_enable;
|
reg [DATA_SIZE_:0] alu_opcode;
|
wire [DATA_SIZE_:0] alu_opcode;
|
reg [DATA_SIZE_:0] alu_a;
|
wire [DATA_SIZE_:0] alu_a;
|
|
|
// all outputs are wires
|
// all outputs are wires
|
wire [DATA_SIZE_:0] alu_result;
|
wire [DATA_SIZE_:0] alu_result;
|
wire [DATA_SIZE_:0] alu_status;
|
wire [DATA_SIZE_:0] alu_status;
|
wire [DATA_SIZE_:0] alu_x;
|
wire [DATA_SIZE_:0] alu_x;
|
wire [DATA_SIZE_:0] alu_y;
|
wire [DATA_SIZE_:0] alu_y;
|
|
|
initial clk = 0;
|
initial clk = 0;
|
always #10 clk <= ~clk;
|
always #10 clk <= ~clk;
|
|
|
//always #100 $write("working");
|
always @(posedge clk) begin
|
|
$display("reset is %b", reset_n);
|
T6507LP_ALU T6507LP_ALU (
|
$display("alu_enable is %b", alu_enable);
|
.clk_i (clk),
|
$display("alu_opcode is %h", alu_opcode);
|
.n_rst_i (reset_n),
|
$display("alu_a is %d", alu_a);
|
|
end
|
|
|
|
t6507lp_alu t6507lp_alu (
|
|
.clk (clk),
|
|
.reset_n (reset_n),
|
.alu_enable (alu_enable),
|
.alu_enable (alu_enable),
|
.alu_result (alu_result),
|
.alu_result (alu_result),
|
.alu_status (alu_status),
|
.alu_status (alu_status),
|
.alu_opcode (alu_opcode),
|
.alu_opcode (alu_opcode),
|
.alu_a (alu_a),
|
.alu_a (alu_a),
|