OpenCores
URL https://opencores.org/ocsvn/dmx512/dmx512/trunk

Subversion Repositories dmx512

[/] [dmx512/] [trunk/] [dmx512.tar] - Diff between revs 3 and 4

Only display areas with differences | Details | Blame | View Log

Rev 3 Rev 4
dmx/0000755000175000017500000000000011431235221012024 5ustar  lekernellekerneldmx/rtl/0000755000175000017500000000000011431045124012626 5ustar  lekernellekerneldmx/rtl/dmx_tx.v0000644000175000017500000001502611431045124014324 0ustar  lekernellekernel/*
dmx/0000755000175000017500000000000011431235221012024 5ustar  lekernellekerneldmx/rtl/0000755000175000017500000000000011431045124012626 5ustar  lekernellekerneldmx/rtl/dmx_tx.v0000644000175000017500000001502611431045124014324 0ustar  lekernellekernel/*
 * Milkymist VJ SoC
 * Milkymist VJ SoC
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 *
 *
 * This program is free software: you can redistribute it and/or modify
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 * the Free Software Foundation, version 3 of the License.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * GNU General Public License for more details.
 *
 *
 * You should have received a copy of the GNU General Public License
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 * along with this program.  If not, see .
 */
 */
module dmx_tx #(
module dmx_tx #(
        parameter csr_addr = 4'h0,
        parameter csr_addr = 4'h0,
        parameter clk_freq = 100000000
        parameter clk_freq = 100000000
) (
) (
        input sys_clk,
        input sys_clk,
        input sys_rst,
        input sys_rst,
        input [13:0] csr_a,
        input [13:0] csr_a,
        input csr_we,
        input csr_we,
        input [31:0] csr_di,
        input [31:0] csr_di,
        output [31:0] csr_do,
        output [31:0] csr_do,
        input thru,
        input thru,
        output tx
        output tx
);
);
/* RAM and CSR interface */
/* RAM and CSR interface */
wire csr_selected = csr_a[13:10] == csr_addr;
wire csr_selected = csr_a[13:10] == csr_addr;
wire csr_channels_we;
wire csr_channels_we;
wire [31:0] csr_do_channels;
wire [31:0] csr_do_channels;
wire [8:0] channel_a;
wire [8:0] channel_a;
wire [7:0] channel_d;
wire [7:0] channel_d;
dmx_dpram channels(
dmx_dpram channels(
        .clk(sys_clk),
        .clk(sys_clk),
        .a(csr_a[8:0]),
        .a(csr_a[8:0]),
        .we(csr_channels_we),
        .we(csr_channels_we),
        .di(csr_di[7:0]),
        .di(csr_di[7:0]),
        .do(csr_do_channels[7:0]),
        .do(csr_do_channels[7:0]),
        .a2(channel_a),
        .a2(channel_a),
        .we2(1'b0),
        .we2(1'b0),
        .di2(8'hxx),
        .di2(8'hxx),
        .do2(channel_d)
        .do2(channel_d)
);
);
assign csr_channels_we = csr_selected & ~csr_a[9] & csr_we;
assign csr_channels_we = csr_selected & ~csr_a[9] & csr_we;
assign csr_do_channels[31:8] = 24'h000000;
assign csr_do_channels[31:8] = 24'h000000;
reg thru_en;
reg thru_en;
reg [31:0] csr_do_reg;
reg [31:0] csr_do_reg;
reg csr_do_sel;
reg csr_do_sel;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(sys_rst) begin
        if(sys_rst) begin
                csr_do_reg <= 32'd0;
                csr_do_reg <= 32'd0;
                csr_do_sel <= 1'b0;
                csr_do_sel <= 1'b0;
                thru_en <= 1'b0;
                thru_en <= 1'b0;
        end else begin
        end else begin
                csr_do_reg <= 32'd0;
                csr_do_reg <= 32'd0;
                csr_do_sel <= 1'b0;
                csr_do_sel <= 1'b0;
                if(csr_selected) begin
                if(csr_selected) begin
                        csr_do_sel <= ~csr_a[9];
                        csr_do_sel <= ~csr_a[9];
                        csr_do_reg <= thru_en;
                        csr_do_reg <= thru_en;
                        if(csr_we) begin
                        if(csr_we) begin
                                if(csr_a[9])
                                if(csr_a[9])
                                        thru_en <= csr_di[0];
                                        thru_en <= csr_di[0];
                        end
                        end
                end
                end
        end
        end
end
end
assign csr_do = csr_do_sel ? csr_do_channels : csr_do_reg;
assign csr_do = csr_do_sel ? csr_do_channels : csr_do_reg;
reg tx_gen;
reg tx_gen;
assign tx = thru_en ? thru : tx_gen;
assign tx = thru_en ? thru : tx_gen;
/* Signal generator */
/* Signal generator */
parameter divisor = clk_freq/250000;
parameter divisor = clk_freq/250000;
reg ce;
reg ce;
reg [8:0] ce_counter;
reg [8:0] ce_counter;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(sys_rst) begin
        if(sys_rst) begin
                ce <= 1'b0;
                ce <= 1'b0;
                ce_counter <= divisor-1;
                ce_counter <= divisor-1;
        end else begin
        end else begin
                if(ce_counter == 9'd0) begin
                if(ce_counter == 9'd0) begin
                        ce <= 1'b1;
                        ce <= 1'b1;
                        ce_counter <= divisor-1;
                        ce_counter <= divisor-1;
                end else begin
                end else begin
                        ce <= 1'b0;
                        ce <= 1'b0;
                        ce_counter <= ce_counter - 9'd1;
                        ce_counter <= ce_counter - 9'd1;
                end
                end
        end
        end
end
end
reg [7:0] channel_d_r;
reg [7:0] channel_d_r;
reg channel_d_ce;
reg channel_d_ce;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(channel_d_ce)
        if(channel_d_ce)
                channel_d_r <= channel_d;
                channel_d_r <= channel_d;
end
end
reg [3:0] tx_sel;
reg [3:0] tx_sel;
parameter TX_SEL_B0 =           4'd0;
parameter TX_SEL_B0 =           4'd0;
parameter TX_SEL_B1 =           4'd1;
parameter TX_SEL_B1 =           4'd1;
parameter TX_SEL_B2 =           4'd2;
parameter TX_SEL_B2 =           4'd2;
parameter TX_SEL_B3 =           4'd3;
parameter TX_SEL_B3 =           4'd3;
parameter TX_SEL_B4 =           4'd4;
parameter TX_SEL_B4 =           4'd4;
parameter TX_SEL_B5 =           4'd5;
parameter TX_SEL_B5 =           4'd5;
parameter TX_SEL_B6 =           4'd6;
parameter TX_SEL_B6 =           4'd6;
parameter TX_SEL_B7 =           4'd7;
parameter TX_SEL_B7 =           4'd7;
parameter TX_SEL_HI =           4'd8;
parameter TX_SEL_HI =           4'd8;
parameter TX_SEL_LO =           4'd9;
parameter TX_SEL_LO =           4'd9;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        case(tx_sel)
        case(tx_sel)
                TX_SEL_B0: tx_gen <= channel_d_r[0];
                TX_SEL_B0: tx_gen <= channel_d_r[0];
                TX_SEL_B1: tx_gen <= channel_d_r[1];
                TX_SEL_B1: tx_gen <= channel_d_r[1];
                TX_SEL_B2: tx_gen <= channel_d_r[2];
                TX_SEL_B2: tx_gen <= channel_d_r[2];
                TX_SEL_B3: tx_gen <= channel_d_r[3];
                TX_SEL_B3: tx_gen <= channel_d_r[3];
                TX_SEL_B4: tx_gen <= channel_d_r[4];
                TX_SEL_B4: tx_gen <= channel_d_r[4];
                TX_SEL_B5: tx_gen <= channel_d_r[5];
                TX_SEL_B5: tx_gen <= channel_d_r[5];
                TX_SEL_B6: tx_gen <= channel_d_r[6];
                TX_SEL_B6: tx_gen <= channel_d_r[6];
                TX_SEL_B7: tx_gen <= channel_d_r[7];
                TX_SEL_B7: tx_gen <= channel_d_r[7];
                TX_SEL_HI: tx_gen <= 1'b1;
                TX_SEL_HI: tx_gen <= 1'b1;
                TX_SEL_LO: tx_gen <= 1'b0;
                TX_SEL_LO: tx_gen <= 1'b0;
                default: tx_gen <= 1'bx;
                default: tx_gen <= 1'bx;
        endcase
        endcase
end
end
reg acounter_reset;
reg acounter_reset;
reg acounter_ce;
reg acounter_ce;
reg frame_done;
reg frame_done;
reg [8:0] acounter;
reg [8:0] acounter;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(ce) begin
        if(ce) begin
                if(acounter_reset) begin
                if(acounter_reset) begin
                        acounter <= 9'd0;
                        acounter <= 9'd0;
                        frame_done <= 1'b0;
                        frame_done <= 1'b0;
                end else if(acounter_ce) begin
                end else if(acounter_ce) begin
                        acounter <= acounter + 9'd1;
                        acounter <= acounter + 9'd1;
                        frame_done <= acounter == 9'd511;
                        frame_done <= acounter == 9'd511;
                end
                end
        end
        end
end
end
assign channel_a = acounter;
assign channel_a = acounter;
reg break_counter_reset;
reg break_counter_reset;
reg [4:0] break_counter;
reg [4:0] break_counter;
reg break_done;
reg break_done;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(ce) begin
        if(ce) begin
                if(break_counter_reset) begin
                if(break_counter_reset) begin
                        break_counter <= 5'd0;
                        break_counter <= 5'd0;
                        break_done <= 1'b0;
                        break_done <= 1'b0;
                end else begin
                end else begin
                        if(break_counter == 5'd25)
                        if(break_counter == 5'd25)
                                break_done <= 1'b1;
                                break_done <= 1'b1;
                        else
                        else
                                break_counter <= break_counter + 5'd1;
                                break_counter <= break_counter + 5'd1;
                end
                end
        end
        end
end
end
reg [4:0] state;
reg [4:0] state;
reg [4:0] next_state;
reg [4:0] next_state;
parameter MTBP =        5'd0;
parameter MTBP =        5'd0;
parameter BREAK =       5'd1;
parameter BREAK =       5'd1;
parameter MAB1 =        5'd2;
parameter MAB1 =        5'd2;
parameter MAB2 =        5'd3;
parameter MAB2 =        5'd3;
parameter SC_START =    5'd4;
parameter SC_START =    5'd4;
parameter SC_D0 =       5'd5;
parameter SC_D0 =       5'd5;
parameter SC_D1 =       5'd6;
parameter SC_D1 =       5'd6;
parameter SC_D2 =       5'd7;
parameter SC_D2 =       5'd7;
parameter SC_D3 =       5'd8;
parameter SC_D3 =       5'd8;
parameter SC_D4 =       5'd9;
parameter SC_D4 =       5'd9;
parameter SC_D5 =       5'd10;
parameter SC_D5 =       5'd10;
parameter SC_D6 =       5'd11;
parameter SC_D6 =       5'd11;
parameter SC_D7 =       5'd12;
parameter SC_D7 =       5'd12;
parameter SC_STOP1 =    5'd13;
parameter SC_STOP1 =    5'd13;
parameter SC_STOP2 =    5'd14;
parameter SC_STOP2 =    5'd14;
parameter START =       5'd15;
parameter START =       5'd15;
parameter D0 =          5'd16;
parameter D0 =          5'd16;
parameter D1 =          5'd17;
parameter D1 =          5'd17;
parameter D2 =          5'd18;
parameter D2 =          5'd18;
parameter D3 =          5'd19;
parameter D3 =          5'd19;
parameter D4 =          5'd20;
parameter D4 =          5'd20;
parameter D5 =          5'd21;
parameter D5 =          5'd21;
parameter D6 =          5'd22;
parameter D6 =          5'd22;
parameter D7 =          5'd23;
parameter D7 =          5'd23;
parameter STOP1 =       5'd24;
parameter STOP1 =       5'd24;
parameter STOP2 =       5'd25;
parameter STOP2 =       5'd25;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(sys_rst)
        if(sys_rst)
                state <= MTBP;
                state <= MTBP;
        else if(ce)
        else if(ce)
                state <= next_state;
                state <= next_state;
end
end
always @(*) begin
always @(*) begin
        tx_sel = TX_SEL_HI;
        tx_sel = TX_SEL_HI;
        acounter_reset = 1'b1;
        acounter_reset = 1'b1;
        acounter_ce = 1'b0;
        acounter_ce = 1'b0;
        break_counter_reset = 1'b1;
        break_counter_reset = 1'b1;
        channel_d_ce = 1'b0;
        channel_d_ce = 1'b0;
        next_state = state;
        next_state = state;
        case(state)
        case(state)
                MTBP: next_state = BREAK;
                MTBP: next_state = BREAK;
                BREAK: begin
                BREAK: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        break_counter_reset = 1'b0;
                        break_counter_reset = 1'b0;
                        if(break_done)
                        if(break_done)
                                next_state = MAB1;
                                next_state = MAB1;
                end
                end
                MAB1: next_state = MAB2;
                MAB1: next_state = MAB2;
                MAB2: next_state = SC_START;
                MAB2: next_state = SC_START;
                SC_START: begin
                SC_START: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D0;
                        next_state = SC_D0;
                end
                end
                SC_D0: begin
                SC_D0: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D1;
                        next_state = SC_D1;
                end
                end
                SC_D1: begin
                SC_D1: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D2;
                        next_state = SC_D2;
                end
                end
                SC_D2: begin
                SC_D2: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D3;
                        next_state = SC_D3;
                end
                end
                SC_D3: begin
                SC_D3: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D4;
                        next_state = SC_D4;
                end
                end
                SC_D4: begin
                SC_D4: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D5;
                        next_state = SC_D5;
                end
                end
                SC_D5: begin
                SC_D5: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D6;
                        next_state = SC_D6;
                end
                end
                SC_D6: begin
                SC_D6: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_D7;
                        next_state = SC_D7;
                end
                end
                SC_D7: begin
                SC_D7: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        next_state = SC_STOP1;
                        next_state = SC_STOP1;
                end
                end
                SC_STOP1: next_state = SC_STOP2;
                SC_STOP1: next_state = SC_STOP2;
                SC_STOP2: next_state = START;
                SC_STOP2: next_state = START;
                START: begin
                START: begin
                        tx_sel = TX_SEL_LO;
                        tx_sel = TX_SEL_LO;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        channel_d_ce = 1'b1;
                        channel_d_ce = 1'b1;
                        next_state = D0;
                        next_state = D0;
                end
                end
                D0: begin
                D0: begin
                        tx_sel = TX_SEL_B0;
                        tx_sel = TX_SEL_B0;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D1;
                        next_state = D1;
                end
                end
                D1: begin
                D1: begin
                        tx_sel = TX_SEL_B1;
                        tx_sel = TX_SEL_B1;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D2;
                        next_state = D2;
                end
                end
                D2: begin
                D2: begin
                        tx_sel = TX_SEL_B2;
                        tx_sel = TX_SEL_B2;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D3;
                        next_state = D3;
                end
                end
                D3: begin
                D3: begin
                        tx_sel = TX_SEL_B3;
                        tx_sel = TX_SEL_B3;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D4;
                        next_state = D4;
                end
                end
                D4: begin
                D4: begin
                        tx_sel = TX_SEL_B4;
                        tx_sel = TX_SEL_B4;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D5;
                        next_state = D5;
                end
                end
                D5: begin
                D5: begin
                        tx_sel = TX_SEL_B5;
                        tx_sel = TX_SEL_B5;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D6;
                        next_state = D6;
                end
                end
                D6: begin
                D6: begin
                        tx_sel = TX_SEL_B6;
                        tx_sel = TX_SEL_B6;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = D7;
                        next_state = D7;
                end
                end
                D7: begin
                D7: begin
                        tx_sel = TX_SEL_B7;
                        tx_sel = TX_SEL_B7;
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        next_state = STOP1;
                        next_state = STOP1;
                end
                end
                STOP1: begin
                STOP1: begin
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        acounter_ce = 1'b1;
                        acounter_ce = 1'b1;
                        next_state = STOP2;
                        next_state = STOP2;
                end
                end
                STOP2: begin
                STOP2: begin
                        acounter_reset = 1'b0;
                        acounter_reset = 1'b0;
                        if(frame_done)
                        if(frame_done)
                                next_state = MTBP;
                                next_state = MTBP;
                        else
                        else
                                next_state = START;
                                next_state = START;
                end
                end
        endcase
        endcase
end
end
endmodule
endmodule
dmx/rtl/dmx_dpram.v0000644000175000017500000000243211431045124014771 0ustar  lekernellekernel/*
dmx/rtl/dmx_dpram.v0000644000175000017500000000243211431045124014771 0ustar  lekernellekernel/*
 * Milkymist VJ SoC
 * Milkymist VJ SoC
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 *
 *
 * This program is free software: you can redistribute it and/or modify
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 * the Free Software Foundation, version 3 of the License.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * GNU General Public License for more details.
 *
 *
 * You should have received a copy of the GNU General Public License
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 * along with this program.  If not, see .
 */
 */
module dmx_dpram #(
module dmx_dpram #(
        parameter depth = 9,
        parameter depth = 9,
        parameter width = 8
        parameter width = 8
) (
) (
        input clk,
        input clk,
        input [depth-1:0] a,
        input [depth-1:0] a,
        input we,
        input we,
        input [width-1:0] di,
        input [width-1:0] di,
        output reg [width-1:0] do,
        output reg [width-1:0] do,
        input [depth-1:0] a2,
        input [depth-1:0] a2,
        input we2,
        input we2,
        input [width-1:0] di2,
        input [width-1:0] di2,
        output reg [width-1:0] do2
        output reg [width-1:0] do2
);
);
reg [width-1:0] ram[0:(1 << depth)-1];
reg [width-1:0] ram[0:(1 << depth)-1];
always @(posedge clk) begin
always @(posedge clk) begin
        if(we)
        if(we)
                ram[a] <= di;
                ram[a] <= di;
        do <= ram[a];
        do <= ram[a];
        if(we2)
        if(we2)
                ram[a2] <= di2;
                ram[a2] <= di2;
        do2 <= ram[a2];
        do2 <= ram[a2];
end
end
// synthesis translate_off
// synthesis translate_off
integer i;
integer i;
initial begin
initial begin
        for(i=0;i<(1 << depth);i=i+1)
        for(i=0;i<(1 << depth);i=i+1)
                ram[i] = {width{1'b0}};
                ram[i] = {width{1'b0}};
        ram[0] = 8'h55;
        ram[0] = 8'h55;
        ram[1] = 8'haa;
        ram[1] = 8'haa;
        ram[511] = 8'hff;
        ram[511] = 8'hff;
end
end
// synthesis translate_on
// synthesis translate_on
endmodule
endmodule
dmx/rtl/dmx_rx.v0000644000175000017500000001227611431045124014326 0ustar  lekernellekernel/*
dmx/rtl/dmx_rx.v0000644000175000017500000001227611431045124014326 0ustar  lekernellekernel/*
 * Milkymist VJ SoC
 * Milkymist VJ SoC
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 *
 *
 * This program is free software: you can redistribute it and/or modify
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 * the Free Software Foundation, version 3 of the License.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * GNU General Public License for more details.
 *
 *
 * You should have received a copy of the GNU General Public License
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 * along with this program.  If not, see .
 */
 */
module dmx_rx #(
module dmx_rx #(
        parameter csr_addr = 4'h0,
        parameter csr_addr = 4'h0,
        parameter clk_freq = 100000000
        parameter clk_freq = 100000000
) (
) (
        input sys_clk,
        input sys_clk,
        input sys_rst,
        input sys_rst,
        input [13:0] csr_a,
        input [13:0] csr_a,
        input csr_we,
        input csr_we,
        input [31:0] csr_di,
        input [31:0] csr_di,
        output [31:0] csr_do,
        output [31:0] csr_do,
        input rx
        input rx
);
);
/* RAM and CSR interface */
/* RAM and CSR interface */
wire csr_selected = csr_a[13:10] == csr_addr;
wire csr_selected = csr_a[13:10] == csr_addr;
wire [7:0] csr_channel;
wire [7:0] csr_channel;
reg [8:0] channel_a;
reg [8:0] channel_a;
reg channel_we;
reg channel_we;
reg [7:0] channel_d;
reg [7:0] channel_d;
dmx_dpram channels(
dmx_dpram channels(
        .clk(sys_clk),
        .clk(sys_clk),
        .a(csr_a[8:0]),
        .a(csr_a[8:0]),
        .we(1'b0),
        .we(1'b0),
        .di(8'hxx),
        .di(8'hxx),
        .do(csr_channel),
        .do(csr_channel),
        .a2(channel_a),
        .a2(channel_a),
        .we2(channel_we),
        .we2(channel_we),
        .di2(channel_d),
        .di2(channel_d),
        .do2()
        .do2()
);
);
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(channel_we)
        if(channel_we)
                $display("Received value %x for channel %x", channel_d, channel_a);
                $display("Received value %x for channel %x", channel_d, channel_a);
end
end
reg csr_selected_r;
reg csr_selected_r;
always @(posedge sys_clk)
always @(posedge sys_clk)
        csr_selected_r <= csr_selected;
        csr_selected_r <= csr_selected;
assign csr_do = {24'h000000, csr_selected_r ? csr_channel : 8'h00};
assign csr_do = {24'h000000, csr_selected_r ? csr_channel : 8'h00};
/* Synchronizer */
/* Synchronizer */
reg rx_r0;
reg rx_r0;
reg rx_r;
reg rx_r;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        rx_r0 <= rx;
        rx_r0 <= rx;
        rx_r <= rx_r0;
        rx_r <= rx_r0;
end
end
/* Signal decoder */
/* Signal decoder */
parameter divisor = clk_freq/250000;
parameter divisor = clk_freq/250000;
parameter halfbit = clk_freq/500000;
parameter halfbit = clk_freq/500000;
reg ce_load;
reg ce_load;
reg ce;
reg ce;
reg [8:0] ce_counter;
reg [8:0] ce_counter;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(ce_load) begin
        if(ce_load) begin
                ce <= 1'b0;
                ce <= 1'b0;
                ce_counter <= halfbit-1;
                ce_counter <= halfbit-1;
        end else begin
        end else begin
                if(ce_counter == 9'd0) begin
                if(ce_counter == 9'd0) begin
                        ce <= 1'b1;
                        ce <= 1'b1;
                        ce_counter <= divisor-1;
                        ce_counter <= divisor-1;
                end else begin
                end else begin
                        ce <= 1'b0;
                        ce <= 1'b0;
                        ce_counter <= ce_counter - 9'd1;
                        ce_counter <= ce_counter - 9'd1;
                end
                end
        end
        end
end
end
reg channel_a_reset;
reg channel_a_reset;
reg channel_a_ce;
reg channel_a_ce;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(channel_a_reset)
        if(channel_a_reset)
                channel_a <= 9'd0;
                channel_a <= 9'd0;
        else if(channel_a_ce)
        else if(channel_a_ce)
                channel_a <= channel_a + 9'd1;
                channel_a <= channel_a + 9'd1;
end
end
reg channel_d_load_en;
reg channel_d_load_en;
reg [2:0] channel_d_load;
reg [2:0] channel_d_load;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(channel_d_load_en)
        if(channel_d_load_en)
                channel_d[channel_d_load] <= rx_r;
                channel_d[channel_d_load] <= rx_r;
end
end
parameter break_threshold = clk_freq/11364;
parameter break_threshold = clk_freq/11364;
reg [12:0] break_counter;
reg [12:0] break_counter;
wire break = break_counter == 13'd0;
wire break = break_counter == 13'd0;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(sys_rst|rx_r)
        if(sys_rst|rx_r)
                break_counter <= break_threshold;
                break_counter <= break_threshold;
        else if(~break)
        else if(~break)
                break_counter <= break_counter - 13'd1;
                break_counter <= break_counter - 13'd1;
end
end
reg [3:0] state;
reg [3:0] state;
reg [3:0] next_state;
reg [3:0] next_state;
parameter WAIT_BREAK =          4'd0;
parameter WAIT_BREAK =          4'd0;
parameter WAIT_MAB =            4'd1;
parameter WAIT_MAB =            4'd1;
parameter WAIT_START =          4'd2;
parameter WAIT_START =          4'd2;
parameter SAMPLE_START =        4'd3;
parameter SAMPLE_START =        4'd3;
parameter SAMPLE0 =             4'd4;
parameter SAMPLE0 =             4'd4;
parameter SAMPLE1 =             4'd5;
parameter SAMPLE1 =             4'd5;
parameter SAMPLE2 =             4'd6;
parameter SAMPLE2 =             4'd6;
parameter SAMPLE3 =             4'd7;
parameter SAMPLE3 =             4'd7;
parameter SAMPLE4 =             4'd8;
parameter SAMPLE4 =             4'd8;
parameter SAMPLE5 =             4'd9;
parameter SAMPLE5 =             4'd9;
parameter SAMPLE6 =             4'd10;
parameter SAMPLE6 =             4'd10;
parameter SAMPLE7 =             4'd11;
parameter SAMPLE7 =             4'd11;
parameter SAMPLE_STOP1 =        4'd12;
parameter SAMPLE_STOP1 =        4'd12;
parameter SAMPLE_STOP2 =        4'd13;
parameter SAMPLE_STOP2 =        4'd13;
always @(posedge sys_clk) begin
always @(posedge sys_clk) begin
        if(sys_rst)
        if(sys_rst)
                state <= WAIT_BREAK;
                state <= WAIT_BREAK;
        else
        else
                state <= next_state;
                state <= next_state;
end
end
/* skip 1st byte (start code) */
/* skip 1st byte (start code) */
reg skip;
reg skip;
reg next_skip;
reg next_skip;
always @(posedge sys_clk)
always @(posedge sys_clk)
        skip <= next_skip;
        skip <= next_skip;
always @(*) begin
always @(*) begin
        ce_load = 1'b0;
        ce_load = 1'b0;
        channel_a_reset = 1'b0;
        channel_a_reset = 1'b0;
        channel_a_ce = 1'b0;
        channel_a_ce = 1'b0;
        channel_we = 1'b0;
        channel_we = 1'b0;
        channel_d_load_en = 1'b0;
        channel_d_load_en = 1'b0;
        channel_d_load = 3'bxxx;
        channel_d_load = 3'bxxx;
        next_state = state;
        next_state = state;
        next_skip = skip;
        next_skip = skip;
        case(state)
        case(state)
                WAIT_BREAK: begin
                WAIT_BREAK: begin
                        ce_load = 1'b1;
                        ce_load = 1'b1;
                        channel_a_reset = 1'b1;
                        channel_a_reset = 1'b1;
                        next_skip = 1'b1;
                        next_skip = 1'b1;
                        if(break)
                        if(break)
                                next_state = WAIT_MAB;
                                next_state = WAIT_MAB;
                end
                end
                WAIT_MAB: begin
                WAIT_MAB: begin
                        ce_load = 1'b1;
                        ce_load = 1'b1;
                        channel_a_reset = 1'b1;
                        channel_a_reset = 1'b1;
                        if(rx_r)
                        if(rx_r)
                                next_state = WAIT_START;
                                next_state = WAIT_START;
                end
                end
                WAIT_START: begin
                WAIT_START: begin
                        ce_load = 1'b1;
                        ce_load = 1'b1;
                        if(~rx_r)
                        if(~rx_r)
                                next_state = SAMPLE_START;
                                next_state = SAMPLE_START;
                end
                end
                SAMPLE_START: begin
                SAMPLE_START: begin
                        if(ce) begin
                        if(ce) begin
                                if(rx_r) /* confirm start bit */
                                if(rx_r) /* confirm start bit */
                                        next_state = WAIT_BREAK;
                                        next_state = WAIT_BREAK;
                                else
                                else
                                        next_state = SAMPLE0;
                                        next_state = SAMPLE0;
                        end
                        end
                end
                end
                SAMPLE0: begin
                SAMPLE0: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd0;
                        channel_d_load = 3'd0;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE1;
                                next_state = SAMPLE1;
                end
                end
                SAMPLE1: begin
                SAMPLE1: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd1;
                        channel_d_load = 3'd1;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE2;
                                next_state = SAMPLE2;
                end
                end
                SAMPLE2: begin
                SAMPLE2: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd2;
                        channel_d_load = 3'd2;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE3;
                                next_state = SAMPLE3;
                end
                end
                SAMPLE3: begin
                SAMPLE3: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd3;
                        channel_d_load = 3'd3;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE4;
                                next_state = SAMPLE4;
                end
                end
                SAMPLE4: begin
                SAMPLE4: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd4;
                        channel_d_load = 3'd4;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE5;
                                next_state = SAMPLE5;
                end
                end
                SAMPLE5: begin
                SAMPLE5: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd5;
                        channel_d_load = 3'd5;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE6;
                                next_state = SAMPLE6;
                end
                end
                SAMPLE6: begin
                SAMPLE6: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd6;
                        channel_d_load = 3'd6;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE7;
                                next_state = SAMPLE7;
                end
                end
                SAMPLE7: begin
                SAMPLE7: begin
                        channel_d_load_en = 1'b1;
                        channel_d_load_en = 1'b1;
                        channel_d_load = 3'd7;
                        channel_d_load = 3'd7;
                        if(ce)
                        if(ce)
                                next_state = SAMPLE_STOP1;
                                next_state = SAMPLE_STOP1;
                end
                end
                SAMPLE_STOP1: begin
                SAMPLE_STOP1: begin
                        if(ce) begin
                        if(ce) begin
                                if(rx_r) /* verify 1st stop bit */
                                if(rx_r) /* verify 1st stop bit */
                                        next_state = SAMPLE_STOP2;
                                        next_state = SAMPLE_STOP2;
                                else
                                else
                                        next_state = WAIT_BREAK;
                                        next_state = WAIT_BREAK;
                        end
                        end
                end
                end
                SAMPLE_STOP2: begin
                SAMPLE_STOP2: begin
                        if(ce) begin
                        if(ce) begin
                                if(rx_r) begin /* verify 2nd stop bit */
                                if(rx_r) begin /* verify 2nd stop bit */
                                        next_skip = 1'b0;
                                        next_skip = 1'b0;
                                        if(~skip) begin
                                        if(~skip) begin
                                                channel_we = 1'b1;
                                                channel_we = 1'b1;
                                                channel_a_ce = 1'b1;
                                                channel_a_ce = 1'b1;
                                        end
                                        end
                                        next_state = WAIT_START;
                                        next_state = WAIT_START;
                                end else
                                end else
                                        next_state = WAIT_BREAK;
                                        next_state = WAIT_BREAK;
                        end
                        end
                end
                end
        endcase
        endcase
end
end
endmodule
endmodule
dmx/test/0000755000175000017500000000000011431045124013004 5ustar  lekernellekerneldmx/test/tb_dmx.v0000644000175000017500000000407011431045124014451 0ustar  lekernellekernel/*
dmx/test/0000755000175000017500000000000011431045124013004 5ustar  lekernellekerneldmx/test/tb_dmx.v0000644000175000017500000000407011431045124014451 0ustar  lekernellekernel/*
 * Milkymist VJ SoC
 * Milkymist VJ SoC
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
 *
 *
 * This program is free software: you can redistribute it and/or modify
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 * the Free Software Foundation, version 3 of the License.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * GNU General Public License for more details.
 *
 *
 * You should have received a copy of the GNU General Public License
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 * along with this program.  If not, see .
 */
 */
module tb_dmx();
module tb_dmx();
reg sys_clk;
reg sys_clk;
reg sys_rst;
reg sys_rst;
/* 83.333MHz system clock */
/* 83.333MHz system clock */
initial sys_clk = 1'b0;
initial sys_clk = 1'b0;
always #6 sys_clk = ~sys_clk;
always #6 sys_clk = ~sys_clk;
reg [13:0] csr_a;
reg [13:0] csr_a;
reg csr_we;
reg csr_we;
reg [31:0] csr_di;
reg [31:0] csr_di;
wire [31:0] csr_do_tx;
wire [31:0] csr_do_tx;
wire [31:0] csr_do_rx;
wire [31:0] csr_do_rx;
wire dmx_signal;
wire dmx_signal;
dmx_tx #(
dmx_tx #(
        .csr_addr(4'h0),
        .csr_addr(4'h0),
        .clk_freq(83333333)
        .clk_freq(83333333)
) tx_dut (
) tx_dut (
        .sys_clk(sys_clk),
        .sys_clk(sys_clk),
        .sys_rst(sys_rst),
        .sys_rst(sys_rst),
        .csr_a(csr_a),
        .csr_a(csr_a),
        .csr_we(csr_we),
        .csr_we(csr_we),
        .csr_do(csr_do_tx),
        .csr_do(csr_do_tx),
        .csr_di(csr_di),
        .csr_di(csr_di),
        .thru(1'b0),
        .thru(1'b0),
        .tx(dmx_signal)
        .tx(dmx_signal)
);
);
dmx_rx #(
dmx_rx #(
        .csr_addr(4'h1),
        .csr_addr(4'h1),
        .clk_freq(83333333)
        .clk_freq(83333333)
) rx_dut (
) rx_dut (
        .sys_clk(sys_clk),
        .sys_clk(sys_clk),
        .sys_rst(sys_rst),
        .sys_rst(sys_rst),
        .csr_a(csr_a),
        .csr_a(csr_a),
        .csr_we(csr_we),
        .csr_we(csr_we),
        .csr_do(csr_do_rx),
        .csr_do(csr_do_rx),
        .csr_di(csr_di),
        .csr_di(csr_di),
        .rx(dmx_signal)
        .rx(dmx_signal)
);
);
task waitclock;
task waitclock;
begin
begin
        @(posedge sys_clk);
        @(posedge sys_clk);
        #1;
        #1;
end
end
endtask
endtask
task csrwrite;
task csrwrite;
input [31:0] address;
input [31:0] address;
input [31:0] data;
input [31:0] data;
begin
begin
        csr_a = address[16:2];
        csr_a = address[16:2];
        csr_di = data;
        csr_di = data;
        csr_we = 1'b1;
        csr_we = 1'b1;
        waitclock;
        waitclock;
        $display("CSR write: %x=%x", address, data);
        $display("CSR write: %x=%x", address, data);
        csr_we = 1'b0;
        csr_we = 1'b0;
end
end
endtask
endtask
task csrread;
task csrread;
input [31:0] address;
input [31:0] address;
begin
begin
        csr_a = address[16:2];
        csr_a = address[16:2];
        waitclock;
        waitclock;
        $display("CSR read : %x=%x", address, csr_do_tx|csr_do_rx);
        $display("CSR read : %x=%x", address, csr_do_tx|csr_do_rx);
end
end
endtask
endtask
always begin
always begin
        $dumpfile("dmx.vcd");
        $dumpfile("dmx.vcd");
        $dumpvars(0, tx_dut);
        $dumpvars(0, tx_dut);
        $dumpvars(0, rx_dut);
        $dumpvars(0, rx_dut);
        /* Reset / Initialize our logic */
        /* Reset / Initialize our logic */
        sys_rst = 1'b1;
        sys_rst = 1'b1;
        waitclock;
        waitclock;
        sys_rst = 1'b0;
        sys_rst = 1'b0;
        waitclock;
        waitclock;
        csrread(32'h0000);
        csrread(32'h0000);
        csrwrite(32'h0000, 32'hff);
        csrwrite(32'h0000, 32'hff);
        csrread(32'h0000);
        csrread(32'h0000);
        #1000000;
        #1000000;
        csrread(32'h1000);
        csrread(32'h1000);
        csrread(32'h1004);
        csrread(32'h1004);
        #50000000;
        #50000000;
        $finish;
        $finish;
end
end
endmodule
endmodule
dmx/test/Makefile0000644000175000017500000000017711431045124014451 0ustar  lekernellekernelSOURCES=tb_dmx.v $(wildcard ../rtl/*.v)
dmx/test/Makefile0000644000175000017500000000017711431045124014451 0ustar  lekernellekernelSOURCES=tb_dmx.v $(wildcard ../rtl/*.v)
all: sim
all: sim
sim:
sim:
        cver $(SOURCES)
        cver $(SOURCES)
clean:
clean:
        rm -f verilog.log dmx.vcd
        rm -f verilog.log dmx.vcd
.PHONY: clean sim
.PHONY: clean sim
dmx/doc/0000755000175000017500000000000011431240556012600 5ustar  lekernellekerneldmx/doc/dmx.tex0000644000175000017500000000426411431240530014110 0ustar  lekernellekernel\documentclass[a4paper,11pt]{article}
dmx/doc/0000755000175000017500000000000011431543453012602 5ustar  lekernellekerneldmx/doc/dmx.tex0000644000175000017500000000426411431240530014110 0ustar  lekernellekernel\documentclass[a4paper,11pt]{article}
\usepackage{fullpage}
\usepackage{fullpage}
\usepackage[latin1]{inputenc}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[T1]{fontenc}
\usepackage[normalem]{ulem}
\usepackage[normalem]{ulem}
\usepackage[english]{babel}
\usepackage[english]{babel}
\usepackage{listings,babel}
\usepackage{listings,babel}
\lstset{breaklines=true,basicstyle=\ttfamily}
\lstset{breaklines=true,basicstyle=\ttfamily}
\usepackage{graphicx}
\usepackage{graphicx}
\usepackage{moreverb}
\usepackage{moreverb}
\usepackage{url}
\usepackage{url}
\title{DMX cores}
\title{DMX cores}
\author{S\'ebastien Bourdeauducq}
\author{S\'ebastien Bourdeauducq}
\date{August 2010}
\date{August 2010}
\begin{document}
\begin{document}
\setlength{\parindent}{0pt}
\setlength{\parindent}{0pt}
\setlength{\parskip}{5pt}
\setlength{\parskip}{5pt}
\maketitle{}
\maketitle{}
\section{Overview}
\section{Overview}
The DMX cores are made of a transmitter and receiver cores. Both fully implement the DMX512 protocol in hardware and map the DMX channels in the CSR address space.
The DMX cores are made of a transmitter and receiver cores. Both fully implement the DMX512 protocol in hardware and map the DMX channels in the CSR address space.
\section{Channel access}
\section{Channel access}
Both cores map the 512 DMX channels from addresses 0x000 to 0x7fc. The CSR interface is 32-bit and only the 8 lower bits are significant and represent the DMX channel value; the 24 upper bits are always 0. The first DMX channel is mapped at address 0x000, the second at address 0x004, the third at address 0x008 and so forth.
Both cores map the 512 DMX channels from addresses 0x000 to 0x7fc. The CSR interface is 32-bit and only the 8 lower bits are significant and represent the DMX channel value; the 24 upper bits are always 0. The first DMX channel is mapped at address 0x000, the second at address 0x004, the third at address 0x008 and so forth.
The transmitter core continuously transmits a DMX signal containing the channel data. The channel data can be read and written at any time over the CSR interface without any glitch occuring on the transmitted signal.
The transmitter core continuously transmits a DMX signal containing the channel data. The channel data can be read and written at any time over the CSR interface without any glitch occuring on the transmitted signal.
The receiver core continuously tries to receive a DMX signal and updates the channel data. The channel data can be read at any time, and each channel value is updated atomically (i.e. no invalid data is returned if a channel is read over the CSR interface at the same time as it is received).
The receiver core continuously tries to receive a DMX signal and updates the channel data. The channel data can be read at any time, and each channel value is updated atomically (i.e. no invalid data is returned if a channel is read over the CSR interface at the same time as it is received).
\section{Thru mode}
\section{Thru mode}
To be able to act as a traditional DMX receiving device, the transmitting DMX core can simply forward the incoming DMX signal instead of transmitting the data from the host CPU. This mode is enabled by writing a 1 to the offset 0x800, and disabled (default) by writing 0.
To be able to act as a traditional DMX receiving device, the transmitting DMX core can simply forward the incoming DMX signal instead of transmitting the data from the host CPU. This mode is enabled by writing a 1 to the offset 0x800, and disabled (default) by writing 0.
\section*{Copyright notice}
\section*{Copyright notice}
Copyright \copyright 2007-2010 S\'ebastien Bourdeauducq. \\
Copyright \copyright 2007-2010 S\'ebastien Bourdeauducq. \\
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the LICENSE.FDL file at the root of the Milkymist source distribution.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the LICENSE.FDL file at the root of the Milkymist source distribution.
\end{document}
\end{document}
dmx/doc/Makefile0000644000175000017500000000041011431236177014237 0ustar  lekernellekernelTEX=dmx.tex
dmx/doc/Makefile0000644000175000017500000000041011431236177014237 0ustar  lekernellekernelTEX=dmx.tex
DVI=$(TEX:.tex=.dvi)
DVI=$(TEX:.tex=.dvi)
PS=$(TEX:.tex=.ps)
PS=$(TEX:.tex=.ps)
PDF=$(TEX:.tex=.pdf)
PDF=$(TEX:.tex=.pdf)
AUX=$(TEX:.tex=.aux)
AUX=$(TEX:.tex=.aux)
LOG=$(TEX:.tex=.log)
LOG=$(TEX:.tex=.log)
all: $(PDF)
all: $(PDF)
%.dvi: %.tex
%.dvi: %.tex
        latex $<
        latex $<
%.ps: %.dvi
%.ps: %.dvi
        dvips $<
        dvips $<
%.pdf: %.ps
%.pdf: %.ps
        ps2pdf $<
        ps2pdf $<
clean:
clean:
        rm -f $(DVI) $(PS) $(PDF) $(AUX) $(LOG)
        rm -f $(DVI) $(PS) $(PDF) $(AUX) $(LOG)
.PHONY: clean
.PHONY: clean
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.