processors

MicroProcessor vs Microcontroller:

Companies like Intel, AMD make microprocessors, while ARM, TI, etc make microcontrollers. Core component of both of these is processor core. It's the unit that runs instructions and performs computations. A processor core by itself is not very helpful, as it needs a memory from which to fetch instructions, memory to write results, as well as connections to other peripherals.

A microprocessor is advanced processor core with bare minimum connections to it, to make it functional. It will usually have a memory connection (DDR2, DDR3, etc), and a high speed communication channel (i.e PCIE, HyperTransport, etc), which allows it to be connected to any peripheral, that supports that communication protocol. Thus, a microprocessor is not a complete system by itself, but needs memory and other peripheral connections in order to operate. It is fabricated as a chip, and sold to be used in bigger systems.

A microcontroller on the other hand contains simple processor core, along with memory and peripheral bus where all peripherals can be connected. Thus it is a complete system by itself. It is fabricated as a chip, and depending on what peripherals it has, it can be used for that specific purpose.

Processor Types:

In digital hardware design, processors are the backbone. They are present in most of the digital chips, as embedded processors. They are also sold as standalone chips.

Since most of the digital designs involve involve some form of micro-controller or micro-processor,  we will start with these CPU cores. These CPU cores run on their own instruction set (ISA) which tell the CPU core what to do next. Big companies designing CPU cores have their own proprietery ISA. Intel/AMD have x86 ISA, ARM has Thumbs/ARM ISA, TI has MSP430 ISA and so on. We can't use these ISA in our CPU designs freely without violating some patent. However, there are still source implementation of CPU cores around these ISA. Looks like open source implementation of these ISA have GPL/BSD license, so should be safe to use. To See all such open source processors, check this link: http://parallel.princeton.edu/openpiton/open_source_processors.php.

Fortunately, there is open source ISA available that you are free to use in your designs. It isn't designed from any of these proprietary ISA, and hence is going to be free for ever. It's the RISC-V ISA, co-designed by famous David Patterson (author of Computer Architecture book that is used worldwide in graduate computer architecture courses). More info here: https://en.wikipedia.org/wiki/RISC-V

Website for RISC-V is here: https://riscv.org/

Many cores have been implemented using this ISA. You can download source code for Cores, SOC or even buy the processors which are built using this ISA. Link to download here: https://github.com/riscv/riscv-cores-list

Outside of processors, if you want to get code for other cores or IP such as DSP cores, Filter, USB, Bus, etc, you can download such code written in verilog, vhdl, SystemVerilog here: https://opencores.org/

So, there is really no need to write any piece of code from scratch, unless for learning purpose.

As explained above, processors can be open source, or they can be proprietery processors. Most popular processors are:

1. x86 based processors: These are Intel and AMD processors. They are based off Intel's old x86 design. Only AMD and one other company has patent/licensing rights to make x86 chips.

2. ARM based processors: These are processors based off ARM architecture. ARM is a british company, and it used to sell processor design to other companies, which wanted to embed a processor in their own chip. These processors were small and used very little power, so were most suitable for embedded designs. Intel's x86 processors were meant for higher end usage as in desktops, laptops etc where performance was more important than power.

3. Open source designs: Apart from above mentioned proprietery designs, many open source design for processors have crept up. Especially in the last 10 years, there has been a tremendous push to have open source processor, so that anyone can design processors free of royalty or licensing fees. The biggest hurdle to open source processors was something that could be adopted by masses and be scalable for future. RISC-V is the the one gaining most momentum right now.