MCPU | MCPU - A Minimal 8Bit CPU in a 32 Macrocell CPLD

 by   cpldcpu C Version: v1.1 License: No License

kandi X-RAY | MCPU Summary

kandi X-RAY | MCPU Summary

MCPU is a C library typically used in Hardware applications. MCPU has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

MCPU is a minimal cpu aimed to fit into a 32 Macrocell CPLD - one of the smallest available programmable logic devices. While this CPU is not powerful enough for real world applications it has proven itself as a valuable educational tool. The source code is just a single page and easily understood. Both VHDL and Verilog versions are supplied. The package comes with assembler, emulator and extensive documentation. This is an old project from 2001. Since it still seems to be of interest to many, I migrated it to Github for easier maintenance. Please refer to the original project description (pdf) for further information.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              MCPU has a low active ecosystem.
              It has 122 star(s) with 24 fork(s). There are 21 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of MCPU is v1.1

            kandi-Quality Quality

              MCPU has no bugs reported.

            kandi-Security Security

              MCPU has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              MCPU does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              MCPU releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MCPU
            Get all kandi verified functions for this library.

            MCPU Key Features

            No Key Features are available at this moment for MCPU.

            MCPU Examples and Code Snippets

            No Code Snippets are available at this moment for MCPU.

            Community Discussions

            QUESTION

            Selecting correct multilib version for linker automatically
            Asked 2021-May-08 at 11:04

            I am using GCC to compile a program for an Atmel Cortex M4 SAM4S Processor. I need to link the standard libraries libgcc.a and libc.a, and to do so I am currently using the following makefile commands

            ...

            ANSWER

            Answered 2021-May-08 at 11:04

            It seems everything works by using gcc instead of ld for linking. gcc then calls the linker with all the correct options, including all the standard librarier automatically.

            The code shown in the question can be replaced by

            Source https://stackoverflow.com/questions/67186834

            QUESTION

            Struggling with CUDA, Clang and LLVM IR, and getting: CUDA failure: 'Invalid device function'
            Asked 2021-Apr-17 at 16:49

            I am trying to optimize a CUDA code with LLVM passes on a PowerPC system (RHEL 7.6 with no root access) equipped with V100 GPUs, CUDA 10.1, and LLVM 11 (built from source). Also, I tested clang, lli, and opt on a simple C++ code, and everything works just fine.

            After days of searching, reading, and trials-and-errors, I managed to compile a simple CUDA source. The code is the famous axpy:

            ...

            ANSWER

            Answered 2021-Apr-17 at 16:29

            The problem was not related to PowerPC architecture. I needed to pass the fatbin file to the host-side compilation command with -Xclang -fcuda-include-gpubinary -Xclang axpy.fatbin to replicate the whole compilation behavior.

            Here is the corrected Makefile:

            Source https://stackoverflow.com/questions/67070926

            QUESTION

            Why is ARM gcc calling __udivsi3 when dividing by a constant?
            Asked 2021-Mar-26 at 21:21

            I'm using the latest available version of ARM-packaged GCC:

            arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release) Copyright (C) 2020 Free Software Foundation, Inc.

            When I compile this code using "-mcpu=cortex-m0 -mthumb -Ofast":

            ...

            ANSWER

            Answered 2021-Mar-22 at 21:23

            The compiler can only rearrange integer expressions if it knows that the result will be correct for any input allowed by the language.

            Because 7 is co-prime to 2, it is impossible to carry out dividing any input by seven with multiplying and shifting.

            If you know that it is possible for the input that you intend to provide, then you have to do it yourself using the multiply and shift operators.

            Depending on the size of the input, you will have to choose how much to shift so that the output is correct (or at least good enough for your application) and so that the intermediate doesn't overflow. The compiler has no way of knowing what is accurate enough for your application, or what your maximum input will be. If it allows any input up to the maximum of the type, then every multiplication will overflow.

            In general GCC will only carry out division using shifting if the divisor is not co-prime to 2, that is if it is a power of two.

            Source https://stackoverflow.com/questions/66753582

            QUESTION

            What are the possible reasons for registers to be offset by 1 in GDB?
            Asked 2021-Mar-23 at 18:53

            The microcontroller is an STM32 F767ZI, which contains a 32 bit ARM Cortex M7

            When setting values to the registers, the registers all appear to be offset by 1.

            For example, the following code:

            core.S

            ...

            ANSWER

            Answered 2021-Mar-23 at 18:53

            Well, having seen the majority of comments suggesting that it is likely an issue with the GDB server, I decided to give another GDB server a go.

            The outcome was very pleasing:

            For:

            core.S

            Source https://stackoverflow.com/questions/66753102

            QUESTION

            undefined reference to `__floatundisf' when using hard float (PowerPC)
            Asked 2021-Mar-22 at 00:08

            I'm building code for PowerPC with hard float and suddenly getting this issue.

            I understand that this symbol belongs to gcc's soft-float library. What I don't understand is why it's trying to use that at all, despite my efforts to tell it to use hard float.

            make flags:

            ...

            ANSWER

            Answered 2021-Mar-22 at 00:08

            Looking at the GCC docs, __floatundisf converts an unsigned long to a float. If we compile your code* with -O1 and run objdump, we can see that the __floatundisf indeed comes from dividing your u64 by a float:

            Source https://stackoverflow.com/questions/66735235

            QUESTION

            Linking multiple static libraries
            Asked 2021-Mar-17 at 22:25

            let me start by saying that this is my first time really meddling with GCC, so I apologize if this question is not very constructive or has been answered before.

            I have two static libraries:

            "L1.h"

            ...

            ANSWER

            Answered 2021-Mar-17 at 22:25

            My first question is, does the order matter here?

            Yes, literally from gcc documentation:

            -l library

            ...

            It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, ‘foo.o -lz bar.o’ searches library ‘z’ after file foo.o but before bar.o. If bar.o refers to functions in ‘z’, those functions may not be loaded.

            how to tell the linker(?) that there is a strong definition of the function in another static library, or something along those lines?

            Typically in modern embedded:

            Source https://stackoverflow.com/questions/66656557

            QUESTION

            No FPU support with gcc for ARM Cortex M?
            Asked 2021-Mar-08 at 22:18

            I have the following function from a well known benchmark that I am compiling with gcc-arm-none-eabi-10-2020-q4-major:

            ...

            ANSWER

            Answered 2021-Mar-08 at 22:18

            The clue is in the compiler options you already posted:

            -mfpu=fpv5-sp-d16 "sp" means single precision.

            You told it not to generate hardware double instructions, which is correct for most Cortex-M7 processors because they can't execute them. If you have an M7 which can then you need to set the correct fpu argument.

            Source https://stackoverflow.com/questions/66535809

            QUESTION

            Linking library with arm gcc
            Asked 2021-Mar-06 at 09:07

            I'm getting an issue with my embedded c project.

            I'm trying to link libcrc to my project, but I'm getting an undefined reference error.

            I tried boiling the problem down to its simplest form and this is what I have:

            ...

            ANSWER

            Answered 2021-Mar-06 at 09:07

            From the comment that it works for gcc but it's not working for arm-gcc, it looks like you are using a cross-compiler and you are picking up the libraries for the host architecture instead of the libraries for the target architecture.

            When you are using a crosscospiler, you need to make sure that your toolchain environment is properly set, otherwise you will have lot's of problems with the build. Also you need to assure that the libraries which are available your build environment are build for the target architecture. If not, the linker will find the library specified with -L, but inside the library there will be no symbols for your target architecture, so you will get error that the symbols you are using form that library are missing.

            Source https://stackoverflow.com/questions/66503508

            QUESTION

            MPLAB X freeze building using printf
            Asked 2021-Feb-04 at 12:17

            My setup is:

            • MPLAB X IDE v3.40
            • C30 compiler v3.31
            • PIC24FJ128GA306

            Mi problem comes when I try to use printf. I can print a string but not a variable.

            This line is correctly bompiled:

            ...

            ANSWER

            Answered 2021-Feb-04 at 12:17

            I have the solution. The problem was that my project had the legacy libraries actives... Uncheking that option in the project configuration it is running correctly now.

            Source https://stackoverflow.com/questions/66024375

            QUESTION

            Why this function does point to itself with a offset of 1?
            Asked 2021-Jan-25 at 14:28

            I'm trying to write a bare metal blink program for a Nucleo-64 Stm32F401re board using C. However while starting debugging for errors (it didn't blink yet) I found an odd adress for which I found no explanation. This is the output of the relevant part of the disassembly:

            ...

            ANSWER

            Answered 2021-Jan-25 at 14:28

            From the Programming Manual PM0214 of STM32F4:

            Vector table
            The vector table contains the reset value of the stack pointer, and the start addresses, also called exception vectors, for all exception handlers. Figure 11 on page 39 shows the order of the exception vectors in the vector table. The least-significant bit of each vector must be 1, indicating that the exception handler is Thumb code.

            So, the LSb = 1 indicates that the instruction pointed by that vector is a Thumb instruction. Cortex-M cores support only Thumb instruction set. The compiler knows that, and makes LSb = 1 automatically. If you somehow manage to make it 0, it won't work.

            Source https://stackoverflow.com/questions/65884094

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install MCPU

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cpldcpu/MCPU.git

          • CLI

            gh repo clone cpldcpu/MCPU

          • sshUrl

            git@github.com:cpldcpu/MCPU.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular C Libraries

            linux

            by torvalds

            scrcpy

            by Genymobile

            netdata

            by netdata

            redis

            by redis

            git

            by git

            Try Top Libraries by cpldcpu

            light_ws2812

            by cpldcpuC

            Nanite

            by cpldcpuC

            CandleLEDhack

            by cpldcpuC

            PCBFlow

            by cpldcpuPython

            SimPad

            by cpldcpuC