Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Newbie
sskular
Posts: 1
Registered: ‎03-27-2010
0

Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

Hello everyone,

 

I'm new to this so i need rookie help...

 

In my project i am using a KCPSM3 softprocessor, and i dont understand it's input and output ports.

In the documentation it is written that it has 8-bit address for input ports, and 8-bit adress for output ports, and therefore 256 input ports and 256 output ports.

But in its VHDL description it says:

 

  component kcpsm3
    Port (      address : out std_logic_vector(9 downto 0);
            instruction : in std_logic_vector(17 downto 0);
                port_id : out std_logic_vector(7 downto 0);
           write_strobe : out std_logic;
               out_port : out std_logic_vector(7 downto 0);
            read_strobe : out std_logic;
                in_port : in std_logic_vector(7 downto 0);
              interrupt : in std_logic;
          interrupt_ack : out std_logic;
                  reset : in std_logic;
                    clk : in std_logic);
    end component;

 

According to this,  it has only one 8-bit input port 'in_port'. And what does address output signal serves for?

Super Contributor
john.h
Posts: 156
Registered: ‎02-27-2010

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

[ Edited ]

The user guide http://www.xilinx.com/support/documentation/ip_documentation/ug129.pdf has pretty thorough documentation.  Without reviewing too deeply into it myself, the address and instruction are the interface to the program memory while the ports are selected with the port_id and a value read from the in_port or written to the out_port with that port_id to help direct its eventual source or destination.

 

The Xilinx documentation is pretty solid.  Huge kudos to Ken Chapman for this enduring piece of code that helps keeps FPGA designs quick and flexible.

Message Edited by john.h on 03-27-2010 04:11 PM
Xilinx Employee
chapman
Posts: 416
Registered: ‎09-05-2007

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

John - Many thanks for the kind words.

 

‘sskular’ – As well as the primary documentation that should cover your question there is a dedicated PicoBlaze forum and multiple reference designs for the Spartan Starter Kits that include PicoBlaze.

 

http://forums.xilinx.com/xlnx/board?board.id=PicoBlaze 

 

http://www.xilinx.com/products/boards/s3estarter/reference_designs.htm 

http://www.xilinx.com/products/boards/s3astarter/reference_designs.htm

 
Ken Chapman
Principal Engineer, Xilinx UK
Visitor
oaranger125
Posts: 5
Registered: ‎04-23-2012
0

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

Hi Ken,

 

I have a question in the .psm file used for led and lcd routines. A piece of code declaring constants as follow:

 

CONSTANT led_dout, 02; //port for 8-bit le data out

CONSTANT switches,03; //port for 8-bit switch input

 

I think 02 and 03 are just port address assigned for name led_dout and switches. However, when I change the ports to some other numbers i.e. 04, or 05, my program doesnt work anymore. Can you explain a bit ?

 

Thanks

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

[ Edited ]

my program doesnt work anymore. Can you explain a bit ?

 

" doesn't work " is not a problem description which can be easily explained.  Would you agree?

Agreed, Ken Chapman is a very sharp fellow, but why not give him a hint or two?

 

For example:

  • the code does not run
  • the PB code runs fine, but the wrong input data value is read
  • the PB code runs fine, but the output data never changes
  • the PB code runs fine, but the wrong data appears at the output port
  • the input port is never selected (check the port address decoding logic)
  • the output port is never selected (check the port address decoding logic)

 

Have you checked the input and output port logic to make sure port address decoding has changed to match the PB port address assignments?  Have you simulated, or taken any other debugging steps?

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Visitor
oaranger125
Posts: 5
Registered: ‎04-23-2012
0

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

Let me re-describe it:

 

I am working on a small project on Spartan 3E where I want to mirred LEDs output from switch inputs using PicoBlaze. In the attached .psm file, if I assign led_dout to port 02 and switches to port 03:

 

CONSTANT led_dout , 02 ;

CONSTANT switches , 03 ;

 

the program works fine, meaning LEDs light up corresponding to switches.

If i change the input and output ports to other values, for example

 

CONSTANT led_dout , 04 ;

CONSTANT switches , 05 ;

 

and rerun the project, the LEDs is not mirroring the switches anymore. Do I have to follow a specific input/output port assignment for LEDs and switches when using PicoBlaze? 

 

 

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

Do you have a register which will respond to the PicoBlaze address of 04? (this is outside PicoBlaze)

Do you have a data mux which will select switch input pins when PicoBlaze address is 05?  (this is outside PicoBlaze)

 

Let's use an analogy.

 

  • Your girlfriend's email address was wonder_woman@comics.com.  You sent email to that address, and your girlfriend received it.
  • Then you decided to send email to your girlfriend at a different email address:  supergirl@comics.com.  Did she receive your email?  If she did not change her email address, you just sent a smoking hot love letter email to some fellow named 'Bruno' (or worse, your former girlfriend) who happens to be using the supergirl@comics.com email address.

The sender and the recipient must agree on which address to use.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Visitor
oaranger125
Posts: 5
Registered: ‎04-23-2012
0

Re: Need help understanding a KCPSM3 (PicoBlaze softprocessor) and top level design

Hi, I found the piece of code in another .v file that specifies IN_PORT value based on change of PORT_ID which doesnt list any other values rather than 02 and 03. This should be the cause.  Thanks for your help. I like your analogy !

 

Regards