There are several events and topics that I would like to share with the community. In an amicable way, you can write a separate article for each one, but the general lack of time makes it a bit tricky. Our current topics:
If you are not indifferent to the MIPSfpga-plus topic, then at the end there is a small survey on what I should write (or not write) the following article. Your choice will help me navigate and prioritize. Welcome !
Two years after the first release of MIPSfpga, Imagination Technologies released the second version of the package: MIPSfpga 2.0 [ L1 ].
What you should pay attention to:
1 Create a Project in Vivado or Quartus-II
2 Learn how to compile, debug and run C programs
3 Learn MIPS Assembly Programming system
4 More C Programming Practice (optional)
5 Expand the system to add 7-segment displays
6 Expand the system to add a counter
7 Expand the system to add a buzzer
8 Expand the SPI-Light Sensor
9 Expand the system to add a SPI-LCD
10 Interact with peripherals using interrupts
11 Build a DMA engine for transfers between peripherals
12 Build a Data Encryption Standard (DES) engine
13 Learn how to use the Performance Counters
14 Execution of ADD and other arithmetic instruction
15 Execution of instructions and other logic instructions
16 Execution of LW and other related instructions
17 Execution of BEQ and other related instructions
18 Learn how the Hazard Unit is implemented
19 Learn how to use the CorExtend interface.
20 Introduction to the caches available in MIPSfpga
21 Analyze the $ and implement new configurations
22 Cache Controller: Analyze a cache hit and miss
23 Cache Controller: Analyze D $ management policies
24 Cache Controller: Analyze the Store and Fill Buffers
25 Implement an Instruction Scratchpad RAM
If we take into account that the company Digilent artificially restricts the supply of its motherboards for Xilinx without FPGA to Russia and Ukraine, the picture is not very pleasant. But here we are come to the rescue by MIPSfpga-plus - opensource project for building SoC based on MIPSfpga with platform-independent peripherals [ L4 ]. For correct interaction with MIPSfpga 2.0 it may have to be slightly modified.
The Summer School for Young Programmers has opened in Novosibirsk today [ L5 ]. The school curriculum involves the division into workshops [ L6 ], one of which is focused on teaching Verilog and microchip architecture. The guys will be a teacher , Yuri Panchul YuriPanchul , who specifically flew from the States for this business.
Master: Yuri Panchul
Digital hardware, from logic elements to its own processor
Want to learn how to design chips in modern devices - from the phone to the spacecraft? The last 25 years have been doing this using the logic code synthesis methodology in hardware description languages. This technology we will learn in our workshop and is applicable for the design of their own devices.
We will start with the three key building blocks of digital electronics - the logic element, the clock signal and the D-flip-flop, the memory for one bit of information. For clarity, we will master them in the old-fashioned way, connecting the chips with a small degree of integration on the breadboard.
Then we will repeat the constructed schemes in the language of hardware description SystemVerilog and model them on a simulator program. But how can we translate them into microchips? After all, ordering a commercial microcircuit in a factory is very expensive? Fortunately, there are “tunable” programmable logic integrated circuits (FPGAs), the boards with which we will use for our classes.
In addition to exercises with arithmetic blocks and finite automata, we will try to build a simple processor similar in microarchitecture to a Mongoose-V processor inside the New Horizons spacecraft, which flew past Pluto a year ago.
At the same time, we will learn a little programming in assembly language, the concept of interrupts, compare our processor with industrial microcontrollers and embedded microprocessors, right up to the EyeQ5 microprocessor for a self-propelled car, which is scheduled for release in 2020.
This is cool, and I, frankly, I envy these schoolchildren a little - in my childhood this was not the case.
Especially for this event, we wrote a small processor MIPS-architecture: schoolMIPS [ L7 ], which is planned to be used in the educational process. It is built by simplifying the Sarah Harris processor, described in H & H [ L2 ]. Key Features:
Included is a small instruction and slides describing the construction of the processor core in the style similar to H & H [ L2 ].
In addition to writing the processor, a fairly large-scale translation into Russian of various educational materials was made. I will not touch on this topic, because I did not participate, I believe that Yuri YuriPanchul will write more about this in the future.
From September 18 to September 22, a School-Workshop on digital design and computer architecture in the era of systems on a chip (SoC) and Internet technologies (IoT) will take place on the basis of Tomsk State University. The preliminary school program and the list of participants are published on the website [ L8 ]. Your humble servant will also perform there: I plan to tell you about AHB-Lite, connect peripherals to MIPSfpga, work with SDRAM is from the stage. And informally we can discuss Linux, connecting the debugger and any code I brought to MIPSfpga-plus. Come!
Laboratory work MIPSfpga describes the launch of Linux on the SoC, built using Xilinx-specific peripheral modules. Coupled with the problem already mentioned above with access to the boards, this created some difficulties. The necessary minimum for running Linux are: MMU (available as part of MIPS fpga), sufficient memory and UART. At the same time, most of the work on porting the system has already been done by Imagination Technologies, the corresponding code is included in the main branch of the kernel [ L9 ]. Just a week ago, I managed to run Linux on Terasic DE10-Lite and I wouldn’t say that the patch needed for this was very difficult.
Key Features:
Linux version 4.12.2+ (stas@ubuntu) (gcc version 4.9.2 (Codescape GNU Tools 2016.05-03 for MIPS MTI Linux) ) #67 Wed Jul 19 00:07:19 MSK 2017 CPU0 revision is: 00019e60 (MIPS M14KEc) MIPS: machine is terasic,de10lite Determined physical RAM map: memory: 04000000 @ 00000000 (usable) Initrd not found or empty - disabling initrd Primary instruction cache 4kB, VIPT, 2-way, linesize 16 bytes. Primary data cache 4kB, 2-way, VIPT, no aliases, linesize 16 bytes Zone ranges: Normal [mem 0x0000000000000000-0x0000000003ffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x0000000003ffffff] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: console=ttyS0,115200 PID hash table entries: 256 (order: -2, 1024 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 60512K/65536K available (1827K kernel code, 97K rwdata, 320K rodata, 948K init, 184K bss, 5024K reserved , 0K cma-reserved) NR_IRQS:8 clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 38225208935 ns sched_clock: 32 bits at 50MHz, resolution 20ns, wraps every 42949672950ns Console: colour dummy device 80x25 Calibrating delay loop... 10.81 BogoMIPS (lpj=21632) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) devtmpfs: initialized clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns futex hash table entries: 256 (order: -1, 3072 bytes) clocksource: Switched to clocksource MIPS random: fast init done workingset: timestamp_bits=30 max_order=14 bucket_order=0 Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled console [ttyS0] disabled b0400000.serial: ttyS0 at MMIO 0xb0401000 (irq = 0, base_baud = 3125000) is a 16550A console [ttyS0] enabled Freeing unused kernel memory: 948K This architecture does not have kernel memory protection. mount: mounting devpts on /dev/pts failed: No such device mount: mounting tmpfs on /dev/shm failed: Invalid argument mount: mounting tmpfs on /tmp failed: Invalid argument mount: mounting tmpfs on /run failed: Invalid argument Starting logging: OK Initializing random number generator... done. Starting network: ip: socket: Function not implemented ip: socket: Function not implemented FAIL Welcome to MIPSfpga mipsfpga login: root Jan 1 00:00:09 login[43]: root login on 'console' # uname -a Linux mipsfpga 4.12.2+ #67 Wed Jul 19 00:07:19 MSK 2017 mips GNU/Linux # free -m total used free shared buffers cached Mem: 60 3 56 0 0 2 -/+ buffers/cache: 0 59 Swap: 0 0 0
In the near future I plan to prepare a small HOWTO on how to reproduce these results. And I’ll probably write a big article after adding a module to MIPSfpga-plus for working with mmc / sdcard, finishing the bootloader and debugging everything that is needed for an autonomous launch. If someone needs "right now" - let me know.
In June, I completed work on integrating the ADC, which is on board the Altera MAX10, into MIPSfpga-plus. The corresponding code is added to the main branch of the project [ L11 ], with documentation [ L12 ] and an example [ L13 ]. The module, in fact, is a converter between the AHB-Lite bus and Avalon-ST, made taking into account the specifics of a particular ADC. It is very simple in architecture - I tried to make its program interface as similar as possible to the Atmel ATmega88 microcontroller ADC.
Of course, there were no pitfalls, as there are 2 ADC channels available on the Terasic DE10-Lite FPGA (with independent sets of inputs on each), while wiring these inputs the second channel turned out to be entirely grounded, so parallel operation of channels on the DE10-Lite is impossible:
I would like to believe that MIPSfpga-plus will be used a little more often in academic projects where before it was necessary to use a microcontroller or a MAX10 + NIOS-II configuration for the sake of the integrated ADC.
Again, is a separate article needed, where work with ADCs is detailed? Or, in order to understand, is it enough for you to refer to the source code of the module, example, and documentation already given by me?
Do you think the MIPSfpga-plus project is ripe enough for it to have its own recognizable logo? I probably spent more than a dozen hours on him, I already want him to be associated with some positive picture. For some reason, only Big Uh from the cartoon of the same name comes to mind (see KDPV), it is possible that because of his confederate, which is well associated with the originally educational orientation of the project. And in principle, this character is to me deeply likable.
What do you think about this topic? Maybe you can offer some alternative option or, suddenly, among the readers there is an artist who can portray a "cartoon character, remotely resembling the Big Ear, but not to the degree of confusion"?
The author is grateful to the team of translators from David Harris and Sarah Harris “Digital Circuit Design and Computer Architecture” [ L2 ], from Imagination Technologies [ L1 ] for their academic license for modern processor core and educational materials, as well as personally to Yuri Panchul for YuriPanchul for his work on promoting MIPSfpga. Special thanks to Alexander Romanov (HSE, MIEM) [ L15 ] for a sensible and scrupulous approach to the schoolMIPS micro-architecture, as well as to all participants of the Young Russian Chip Architects mailing list who took part in the discussion.
[L1] - Press release on the release of MIPSfpga 2.0 ;
[L2] - Digital circuit design and computer architecture ;
[L3] - Workshop on Computer Architecture Education (Toronto) ;
[L4] - Project MIPSfpga-plus on github ;
[L5] - Summer School for Programmers (Novosibirsk) ;
[L6] - Summer School for Programmers (Novosibirsk). Curriculum ;
[L7] - SchoolMIPS project on github ;
[L8] - Workshop on digital design and computer architecture (Tomsk) ;
[L9] - MIPSfpga support in the Linux kernel ;
[L10] - MIPSfpga and in-circuit debugging ;
[L11] - MIPSfpga-plus. Altera MAX10 ADC Support Module ;
[L12] - MIPSfpga-plus. Altera MAX10 ADC support module. Documentation ;
[L13] - MIPSfpga-plus. Altera MAX10 ADC support module. An example ;
[L14] - Practical experiences based on MIPSfpga ;
[L15] - Alexander Romanov's profile on the HSE website .
Source: https://habr.com/ru/post/333722/