PATH: //opt/alt/python311/share/doc/alt-python311-pyparsing-doc/examples/verilog
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 Ctr3sr.v
↓
X
📄 INIT
↓
X
📄 RANDOM_GATE
↓
X
📄 RANDOM_INTERCONNECT
↓
X
📄 SEED
↓
X
📄 TestCtr3sr.v
↓
X
📄 addacc.v
↓
X
📄 addacc1_dro.v
↓
X
📄 addacc1_t1ff.v
↓
X
📄 addacc_conf.v
↓
X
📄 addacc_dro.v
↓
X
📄 addacc_t1ff.v
↓
X
📄 allParseOutput.zip
↓
X
📄 and.v
↓
X
📄 and_gate.v
↓
X
📄 conf.v
↓
X
📄 core_test.v
↓
X
📄 count2bit.v
↓
X
📄 count_all_prims_test.v
↓
X
📄 count_loads_test.v
↓
X
📄 dds.v
↓
X
📄 diff_udp.v
↓
X
📄 display_all_nets_test.v
↓
X
📄 div16.v
↓
X
📄 dro.v
↓
X
📄 dro1_cell.v
↓
X
📄 dro_cell.v
↓
X
📄 dump_and_fill_mem_test.v
↓
X
📄 exprinfo_test.v
↓
X
📄 fetch_values_test.v
↓
X
📄 ff.v
↓
X
📄 ff_test.v
↓
X
📄 fifo.v
↓
X
📄 find_driver.tcl.gz
↓
X
📄 framer.v
↓
X
📄 func_72bit_test.v
↓
X
📄 gen.v
↓
X
📄 gencrc.v
↓
X
📄 gzip.exe
↓
X
📄 hadd.v
↓
X
📁 hasCompilerDirectives/
X
📄 hello_test.v
↓
X
📄 in_port.v
↓
X
📄 inv.v
↓
X
📄 inv_cell.v
↓
X
📄 invoke_commands_test.v
↓
X
📄 invoke_options_test.v
↓
X
📄 jtl2.v
↓
X
📄 jutzi
↓
X
📄 list_cells_test.v
↓
X
📄 list_nets_test.v
↓
X
📄 list_parameters_test.v
↓
X
📄 list_path_delays_test.v
↓
X
📄 list_pathout_ports_test.v
↓
X
📄 list_prim_delays_test.v
↓
X
📄 load_in.v
↓
X
📄 load_out.v
↓
X
📄 mem_arb.v
↓
X
📄 mipd_delays_test.v
↓
X
📄 mult16.v
↓
X
📄 multi21_udp.v
↓
X
📄 my_monitor1_test.v
↓
X
📄 my_monitor2_test.v
↓
X
📄 my_monitor_test.v
↓
X
📄 my_strobe_test.v
↓
X
📄 myram64x16.v
↓
X
📄 nco.v
↓
X
📄 ndro.v
↓
X
📁 new/
X
📁 new2/
X
📁 new3/
X
📄 nodeinfo_test.v
↓
X
📄 onehot.v
↓
X
📄 or.v
↓
X
📄 out_port.v
↓
X
📁 parseOutput/
X
📄 pic.v
↓
X
📄 pipe1.v
↓
X
📄 pipe2.v
↓
X
📄 pl.v
↓
X
📄 pli_handbook_examples_pc.zip
↓
X
📄 port_info_test.v
↓
X
📄 pow_test.v
↓
X
📄 primitives.v
↓
X
📄 propagatep_test.v
↓
X
📄 psr1.v
↓
X
📄 psr1_conf.v
↓
X
📄 psr1_dro.v
↓
X
📄 psr1_split.v
↓
X
📄 psr2.v
↓
X
📄 psr2_and.v
↓
X
📄 psr2_split.v
↓
X
📄 read_4state_value_test.v
↓
X
📄 read_attribute_test.v
↓
X
📄 read_delays_test.v
↓
X
📄 read_stimulus_short_test.v
↓
X
📄 read_stimulus_test.v
↓
X
📄 read_strengthval_test.v
↓
X
📄 read_test_vector_test.v
↓
X
📄 read_timeval_test.v
↓
X
📄 read_vector_test.v
↓
X
📄 read_vecval_test.v
↓
X
📄 realpow_test.v
↓
X
📄 rf.v
↓
X
📄 sci_alu_comb_calltf_shell.v
↓
X
📄 sci_alu_comb_calltf_test.v
↓
X
📄 sci_alu_comb_misctf_shell.v
↓
X
📄 sci_alu_comb_misctf_test.v
↓
X
📄 sci_alu_combinational_shell.v
↓
X
📄 sci_alu_combinational_test.v
↓
X
📄 sci_alu_latched_shell.v
↓
X
📄 sci_alu_latched_test.v
↓
X
📄 sci_alu_sequential_shell.v
↓
X
📄 sci_alu_sequential_test.v
↓
X
📄 sci_alu_synchronized_shell.v
↓
X
📄 sci_alu_synchronized_test.v
↓
X
📄 sci_alu_with_delays_shell.v
↓
X
📄 sci_alu_with_delays_test.v
↓
X
📄 set_mipd_delays_test.v
↓
X
📄 show_all_nets_test.v
↓
X
📄 show_all_signals1_test.v
↓
X
📄 show_all_signals2_test.v
↓
X
📄 show_all_signals3_test.v
↓
X
📄 show_all_signals_1_test.v
↓
X
📄 show_all_signals_2_test.v
↓
X
📄 show_all_signals_3_test.v
↓
X
📄 show_value_test.v
↓
X
📄 sig_gen.v
↓
X
📄 simple_core.v
↓
X
📄 splitter.v
↓
X
📄 sqrt32.v
↓
X
📄 sqrt8m.v
↓
X
📄 sr_nv_ctf.v
↓
X
📄 srcnt.v
↓
X
📄 string.v
↓
X
📄 t1ff.v
↓
X
📄 testcase.v
↓
X
📄 testcase2.v
↓
X
📄 testcase3.v
↓
X
📄 testcase4.v
↓
X
📄 testcase5.v
↓
X
📄 tff.v
↓
X
📄 timescale_info_test.v
↓
X
📄 usb.v
↓
X
📄 use_workarea_test.v
↓
X
📄 utmi_if.v
↓
X
📄 vpi_utilities_test.v
↓
X
📄 wb.v
↓
X
📄 wpulse.v
↓
X
📄 xor.v
↓
X
📄 zzzexample.v
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: pipe1.v
// pipe1.v Verilog version using modules in this file // basic five stage pipeline of just Instruction Register // The 411 course pipeline has the same five stages // IF Instruction Fetch includes PC and instruction memory // ID Instruction Decode and registers // EX Execution including the ALU Arithmetic Logic Unit // MEM data Memory // WB Write Back into registers // // This self contained Verilog file defines: // // a 32 bit adder module using behavioral code // a 32 bit register module with clock and clear inputs // an instruction memory module using behavioral code // // a top level module, pipe1, test bench // the wires for interconnecting the entities // the modules instantiated to connect the wires // printout that shows the registers in the pipeline each clock // `timescale 1ps/1ps // times in pico seconds module add32(a, b, cin, sum, cout); parameter n=31; input [n:0] a; // a input input [n:0] b; // b input input cin; // carry-in output [n:0] sum; // sum output output cout; // carry-out assign #250 {cout, sum} = a + b + cin; endmodule // add32 module register_32(clk, clear, inp, out); input clk; // accept inp on posedge input clear; // clear when high input [31:0] inp; // input data output [31:0] out; // output of register wire [31:0] inp; wire [31:0] out; reg [31:0] stored; // temporary variable initial stored = 32'h00000000; assign out = stored; // set output wire always @(posedge clk) begin // behavior #200 stored <= inp; end endmodule // register_32 module instruction_memory(addr, inst); input [31:0] addr; output [31:0] inst; integer word_addr; reg [31:0] memory [0:6]; reg [31:0] inst_word; assign inst = inst_word; function [31:0] to_integer; input [31:0] argument; to_integer = argument; endfunction // to_integer initial begin memory[0] = 32'h00000001; memory[1] = 32'h00000002; memory[2] = 32'h00000003; memory[3] = 32'h00000004; memory[4] = 32'h00000005; memory[5] = 32'h00000006; memory[6] = 32'h00000007; end always @(addr) begin // behavior word_addr = to_integer(addr)/4; #250 inst_word = memory[word_addr]; end endmodule // instruction_memory module pipe1; // test bench // signals used in test bench (the interconnections) reg [31:0] zero_32; // = 32'h00000000; // 32 bit zero reg zero; // = 0; // one bit zero reg [31:0] four_32; // = 32'h00000004; // four reg clear; // = 1; // one shot clear reg clk; // = 0; // master clock integer counter; // = 0; // master clock counter, raising edge wire nc1; // a No-Connection for unused output wire [31:0] IF_PC_next; // next value of PC wire [31:0] IF_PC; // Program Counter wire [31:0] inst; // instruction fetched wire [31:0] ID_IR; // ID Instruction Register wire [31:0] EX_IR; // EX Instruction Register wire [31:0] MEM_IR; // MEM Instruction Register wire [31:0] WB_IR; // WB Instruction Register function [31:0] to_integer; input [31:0] argument; to_integer = argument; endfunction // to_integer initial begin zero_32 = 32'h00000000; // 32 bit zero zero = 0; // one bit zero four_32 = 32'h00000004; // four clear = 1; // one shot clear clk = 0; // master clock counter = 0; // master clock counter, raising edge #200 clear = 0; // clear time finished forever #5000 clk = ~clk; // run clock 10ns period end initial #60000 $finish; // stop after 60 ns // schematic of pipe1, behavior and test bench // IF, Instruction Fetch pipeline stage register_32 PC_reg(clk, clear, IF_PC_next, IF_PC); add32 PC_incr(IF_PC, four_32, zero, IF_PC_next, nc1); instruction_memory inst_mem(IF_PC, inst); // ID, Instruction Decode and register stack pipeline stage register_32 ID_IR_reg(clk, clear, inst, ID_IR); // EX, Execute pipeline stage register_32 EX_IR_reg(clk, clear, ID_IR, EX_IR); // MEM Data Memory pipeline stage register_32 MEM_IR_reg(clk, clear, EX_IR, MEM_IR); // WB, Write Back pipeline stage register_32 WB_IR_reg(clk, clear, MEM_IR, WB_IR); always @(posedge clk) // to show state of registers in pipeline begin $write("at clock "); $write("%0d", counter); $write(" PC="); $write("%h", IF_PC); $write("\n"); $write("IF stage inst="); $write("%h", inst); $write("\n"); $write("IF_PC_next ="); $write("%h", IF_PC_next); $write("\n"); $write("ID stage IR="); $write("%h", ID_IR); $write("\n"); $write("EX stage IR="); $write("%h", EX_IR); $write("\n"); $write("MEM stage IR="); $write("%h", MEM_IR); $write("\n"); $write("WB stage IR="); $write("%h", WB_IR); $write("\n"); $write("\n"); // blank line counter = counter+1; end endmodule // pipe1
SIMPAN PERUBAHAN