Commit Graph

7181 Commits

Author SHA1 Message Date
Michal Sieron 3d4a64e112 Update stdio code in libc
Picolibc now requires to create stdin, stdout and stderr files
ourselves instead of __iob array. Thus changes and renaming
of iob.c to stdio.c

f320a0aa17
added option to select default printf format, so using
picolibc.specs or defining PRINTF_LEVEL is no longer needed.
2021-09-16 10:44:07 +02:00
Michal Sieron ef7b287248 Disable thread local storage (TLS) in picolibc
It was causing some compilation issues with lm32.
As global errno was enabled anyway, it was easier 
to disable TLS whatsoever.
2021-09-16 10:43:44 +02:00
Michal Sieron c84105f399 Disable LTO for picolibc and use picolibc.specs
Use picolibc.specs to specify integer only printf/scanf.

To do that, we need to pass specs file with options to
the linker. With LTO enabled, name mapping was failing,
so LTO is now disabled for picolibc compilation only.

This also means, that exchange.c and arc4random.c no
longer need to be recompiled and added back.
2021-09-16 10:43:41 +02:00
Michal Sieron 49c4ae9ec9 Add ppc64le-linux[-musl] to microwatt gcc triples 2021-09-16 10:42:54 +02:00
Michal Sieron 72e7eac0ef Fix demo compilation 2021-09-16 10:42:54 +02:00
Michal Sieron befd9c0e4c Add comment documenting libc/missing.c 2021-09-16 10:42:54 +02:00
Michal Sieron 63094205d7 Add comment documenting libc/iob.c 2021-09-16 10:42:54 +02:00
Michal Sieron c96c7f5c45 Fix machine specific directory copying 2021-09-16 10:42:54 +02:00
Michal Sieron d3c23fb048 Remove libmisc 2021-09-16 10:42:54 +02:00
Michal Sieron 7fcc094b63 Don't filter out INCLUDE flags 2021-09-16 10:42:54 +02:00
Michal Sieron cf59481567 Move machine specific code to their directories 2021-09-16 10:42:54 +02:00
Michal Sieron 66c54de785 Move sim_debug to the BIOS directory 2021-09-16 10:42:54 +02:00
Michal Sieron b960ba0a67 Move stuff out of libbase
Removed libbase completely and moved remaining files into
libutils, libcomm and libmisc.

Libcomm is place for code used for communicating with other
devices, which doesn't yet live in its own liblite*.

Libutils is code used in multiple places, like crc calculation,
progress bar, memtests.

Libmisc is everything else like sim_debug, which is code for
litex_sim or exception.c for or1k.
2021-09-16 10:42:54 +02:00
Michal Sieron 91ce95fb49 Remove obsolete _include/dyld_
As per b5048f6cf1
it was necessary by libunwind, which we aren't building.
2021-09-16 10:42:54 +02:00
Michal Sieron 6dc4908d12 Remove obsolete _include/basec++_
As per 7a9975ab5a
it was necessary to build libunwind, which we aren't building.
2021-09-16 10:42:54 +02:00
Michal Sieron b95acb8182 Remove obsolete _include/fdlibm_ 2021-09-16 10:42:54 +02:00
Michal Sieron 1a1a81bfa0 Move _exit function up, so gcc doesn't complain 2021-09-16 10:42:54 +02:00
Michal Sieron 9f169d5520 Enable long long support in IO operations 2021-09-16 10:42:54 +02:00
Michal Sieron 351a0713af Remove unused base/uart.h include 2021-09-16 10:42:54 +02:00
Michal Sieron 26c5a8a926 Move libbase/id.c to bios/cmd/cmd_bios.c 2021-09-16 10:42:54 +02:00
Michal Sieron 6bff5f1734 Replace inet.h with arpa/inet.h 2021-09-16 10:42:54 +02:00
Michal Sieron 082d1231f6 Remove obsolete time.c 2021-09-16 10:42:54 +02:00
Michal Sieron 823edfad22 Remove obsolete div64.c 2021-09-16 10:42:54 +02:00
Michal Sieron 8e4e3b5438 Enable LTO
Use gcc-ar and gcc-nm, because they have LTO plugins

Turn off LTO for libcompiler_rt, exchange.c and arc4random.c
from newlib.

Also add getentropy, dummy function, because for some reason
libbase/console.c wants it.
2021-09-16 10:42:29 +02:00
Michal Sieron 53135eb7bc Add missing definitions if target is microwatt
Picolibc compilation for powerpc was missing some defines.
This adds them to gcc parameters
2021-09-16 10:41:05 +02:00
Michal Sieron ba1d20f2ad Add missing functions to make lm32 and or1k link
I added missing.c with functions that were preventing
LiteX from successfull linking on lm32 and or1k.
2021-09-16 10:41:05 +02:00
Michal Sieron 4e50c0ba00 Enable global errno
Brings mor1kx compilation to the same error as lm32
2021-09-16 10:41:05 +02:00
Michal Sieron ab881c561f Implement initial support for lm32 and or1k
Picolibc doesn't maintain meson.build or cross*.txt files
for lm32 and or1k CPUs.

This commit adds meson.build files for both of them.
Also libc/Makefile got modifed to determine CPU family
from $(CPU) value and generate cross.txt file.
Now picolibc gets compiled with LiteX flags too.

It doesn't compile on neither of them yet,
but at least riscv still works.
2021-09-16 10:41:05 +02:00
Michal Sieron ca4e17d886 Disable float support in tinystdio
Float support was originally disabled in libbase
2021-09-16 10:41:05 +02:00
Michal Sieron b34adcf929 Remove libbase-nofloat.a variant
As vsnprintf is no longer compiled it was
identical to libbase.a.

Picolibc defines levels of printf and scanf
https://github.com/picolibc/picolibc/blob/main/doc/printf.md#printf-and-scanf-levels-in-picolibc
so those should probably be used.
2021-09-16 10:41:05 +02:00
Michal Sieron c4ba313b86 Remove unnecessary header and source files 2021-09-16 10:41:05 +02:00
Michal Sieron a6094fd418 Move libbase/console.c logic to libc/iob.c 2021-09-16 10:41:05 +02:00
Michal Sieron 768961ec59 Use getchar/putchar instead of readchar/base_putchar 2021-09-16 10:41:05 +02:00
Michal Sieron ead3f8b2e0 Compile iob.c with $(compile) 2021-09-16 10:41:05 +02:00
Michal Sieron 8a38a79967 Remove unnecessary headers 2021-09-16 10:41:05 +02:00
Michal Sieron 10927691c5 Remove base and add picolibc to include search paths 2021-09-16 10:41:05 +02:00
Michal Sieron 19966edb61 Replace putsnonl(s) with fputs(s, stdout)
It won't compile, because stdout is undefined, but
including headers from picolibc should fix that
2021-09-16 10:41:05 +02:00
Michal Sieron acf3a4570b Create __iob for picolibc
Picolibc requires __iob array for its IO functions

This commit creates such array with dummy functions
using putchar/readchar from console.c

To prevent name conflicts printf and others were
removed from console.c

Also putchar had to be renamed to base_putchar
2021-09-16 10:41:05 +02:00
Michal Sieron db390537a9 Compile entire picolibc
It does not compile yet, will need __iob array to be defined
Also there are multiple definitions of some functions
2021-09-16 10:41:05 +02:00
Michal Sieron 514754bedf Get pythondata-software-picolibc from antmicro 2021-09-16 10:41:05 +02:00
Michal Sieron fc0fa88e33 Update litex_setup.py to use forked codebase 2021-09-16 10:41:05 +02:00
Michal Sieron 6de59bdbc0 Incorporate picolibc into the build process
Right now it is still limited as it compiles only for one target,
but it should be possible to build BIOS with one command

Tested with digilent_arty.py
2021-09-16 10:41:05 +02:00
Michał Sieroń e25ca4082b Apply patch removing need for most of libbase 2021-09-16 10:41:05 +02:00
Florent Kermarrec beb7cc691d CHANGES: Do 2021.08 release. 2021-09-15 15:05:47 +02:00
Florent Kermarrec 343d88e837 setup.py: Expose litex_contributors tool. 2021-09-15 14:38:45 +02:00
Florent Kermarrec 05b960d09b CHANGES: Update. 2021-09-15 12:08:30 +02:00
enjoy-digital 02896a4a30
Merge pull request #1037 from thirtythreeforty/ecp5-pll
Fix premature selection of full PLL config with no feedback
2021-09-15 08:52:59 +02:00
George Hilliard 91ec6e0da8 clock/lattice_ecp5/ECP5PLL: emit frequency annotations to help Diamond
Unlike nextpnr, Diamond appears not to infer the frequency of the
outputs.  Emit the same attributes that Diamond's PLL tool does.
2021-09-15 00:07:43 -05:00
George Hilliard 6733a3e3e6 clock/lattice_ecp5/ECP5PLL: ensure feedback path selected before exiting search 2021-09-15 00:07:43 -05:00
Florent Kermarrec 88d302d4db soc/alloc_region: Ensure allocated Region is aligned on size. 2021-09-14 18:08:07 +02:00