`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    13:08:03 03/24/2017 
// Design Name: 
// Module Name:    bram_pico 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module bram_pico(
    input clk,
	 input [7:0] switches,
	 output reg [7:0] leds,
    input reset
    );

//picoblaze signals
wire [9:0]	address ;
wire [17:0]	instruction ;
wire [7:0]	port_id ;
wire write_strobe, read_strobe, interrupt_ack ;
wire [7:0]	out_port ;
reg [7:0] in_port ;
wire interrupt;

//bram signals
wire [7:0] dout;

kcpsm3 picoblaze (
    .address(address), 
    .instruction(instruction), 
    .port_id(port_id), 
    .write_strobe(write_strobe), 
    .out_port(out_port), 
    .read_strobe(read_strobe), 
    .in_port(switches), 
    .interrupt(interrupt), 
    .interrupt_ack(interrupt_ack), 
    .reset(reset), 
    .clk(clk)
    );



rom1 imemory (
    .address(address), 
    .instruction(instruction), 
    .clk(clk)
    );


always @*
begin
	if(write_strobe==1)
	begin
		leds<=out_port;
	end
end

endmodule
