Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

How to create a simple Cpu??

Hi guys, I have received another tough assignment which i don't know from which point to start from. I am hoping altera gurus can be of help.

The assignment is to create a simple cpu that has a rom, bus and led output. The vhdl block diagram should be used to create different blocks for each meaning the cpu has a block, rom and led output and all this are interconnected to function properly.

Can anyone help with this?

Thanks

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I tried to build it by using Qsys i Quartus II but it does not look anything close to the video of the teacher. He has both Vhd file for this and a schematic diagram. This makes me confuse.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Qsys is a system generator. So you need existing modules and Qsys connects them together. The NIOS is an existing processor. If your job is to create a processor in VHDL, you probably dont want to use Qsys. He possibly has a VHDL file and a .bdf (graphical schematic) file.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Qsys is a system generator. So you need existing modules and Qsys connects them together. The NIOS is an existing processor. If your job is to create a processor in VHDL, you probably dont want to use Qsys. He possibly has a VHDL file and a .bdf (graphical schematic) file.

    --- Quote End ---

    ----------------------------------------------

    You are right, does this mean i have to write the vhdl code for this processor from scratch. Oops this is not going to be easy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Possibly - Your assignment is very broad. Were you at least given and instruction set to work with?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You can find the project description below:

    A) Description of the bus, ROM and LED blocks

    This will address the block outside the CPU, through a bus. Every block that is connected to the bus has a unique(independent) address. In this case:

     ROM: addresses 0-15 (16 addresses)

     LED: addresses 10 (1 address)

    This is what is called an (Address map).

    B) Description of the ROM program

    In the memory (ROM) there exist a program with machine codes or easy to read assembler codes

    signal rom : memory_t := memory_t'(

    X"0000", -- 0 NOP ”do not do anything, No Operation” nop

    X"100A", -- 1 LOAD_R0# A ”Load CPU_REG_0 with A (hex)” R0 = 10;

    X"2010", -- 2 STORE_R0# 10 ”Store CPU_REG_0 to adress 10 (hex)” LEDS = R0

    X"1001", -- 3 LOAD_R0# 1 ”Load CPU_REG_0 with 1 (hex)” R0 = 01;

    X"2010", -- 4 STORE_R0# 10 ”Store CPU_REG_0 to adress 10 (hex)” LEDS = R0

    This is just the main description, hope it helps