mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-26 10:42:26 -04:00
msksim.f90 is being used to learn how to call ldpc encode/decode C routines. nothing works yet.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6485 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
03656e17e5
commit
c5d044712e
@ -70,7 +70,6 @@ progs: modules
|
|||||||
$(LINK) verify.o mod2sparse.o mod2dense.o mod2convert.o check.o \
|
$(LINK) verify.o mod2sparse.o mod2dense.o mod2convert.o check.o \
|
||||||
rcode.o alloc.o intio.o blockio.o open.o -lm -o verify
|
rcode.o alloc.o intio.o blockio.o open.o -lm -o verify
|
||||||
|
|
||||||
|
|
||||||
# MAKE THE TEST PROGRAMS. First makes the modules used.
|
# MAKE THE TEST PROGRAMS. First makes the modules used.
|
||||||
|
|
||||||
tests: modules
|
tests: modules
|
||||||
|
39
lib/ldpc/Makefile.msk_osx
Normal file
39
lib/ldpc/Makefile.msk_osx
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Compilers
|
||||||
|
CC = gcc
|
||||||
|
CXX = g++
|
||||||
|
FC = gfortran
|
||||||
|
AR = ar cr
|
||||||
|
RANLIB = ranlib
|
||||||
|
MKDIR = mkdir -p
|
||||||
|
CP = cp
|
||||||
|
RM = rm -f
|
||||||
|
|
||||||
|
FFLAGS = -O2 -fbounds-check -Wall -Wno-conversion
|
||||||
|
CFLAGS = -O2 -I.
|
||||||
|
|
||||||
|
# Default rules
|
||||||
|
%.o: %.c
|
||||||
|
${CC} ${CFLAGS} -c $<
|
||||||
|
%.o: %.f
|
||||||
|
${FC} ${FFLAGS} -c $<
|
||||||
|
%.o: %.F
|
||||||
|
${FC} ${FFLAGS} -c $<
|
||||||
|
%.o: %.f90
|
||||||
|
${FC} ${FFLAGS} -c $<
|
||||||
|
%.o: %.F90
|
||||||
|
${FC} ${FFLAGS} -c $<
|
||||||
|
|
||||||
|
all: msksim
|
||||||
|
|
||||||
|
OBJS = msksim.o alloc.o rcode.o channel.o dec.o enc.o \
|
||||||
|
intio.o blockio.o check.o open.o mod2dense.o \
|
||||||
|
mod2sparse.o mod2convert.o distrib.o rand.o
|
||||||
|
|
||||||
|
msksim: $(OBJS)
|
||||||
|
$(FC) -o msksim $(OBJS)
|
||||||
|
|
||||||
|
rand.o:
|
||||||
|
$(CC) -DRAND_FILE=\"`pwd`/randfile\" rand.c
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) *.o msksim
|
@ -383,3 +383,9 @@ void iterprp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ldpc_decode_ ( mod2sparse *H, double *lratio, char *dblk, char *pchk, double *bprb )
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
n = prprp_decode ( H, lratio, dblk, pchk, bprb );
|
||||||
|
}
|
||||||
|
@ -152,3 +152,12 @@ void mixed_encode
|
|||||||
{ cblk[cols[j]] = mod2dense_get(v,j,0);
|
{ cblk[cols[j]] = mod2dense_get(v,j,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrapper for calling sparse_encode from fortran
|
||||||
|
void ldpc_encode_(
|
||||||
|
char msg[72],
|
||||||
|
char cdw[128]
|
||||||
|
){
|
||||||
|
sparse_encode(msg,cdw);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -16,3 +16,4 @@
|
|||||||
void sparse_encode (char *, char *);
|
void sparse_encode (char *, char *);
|
||||||
void dense_encode (char *, char *, mod2dense *, mod2dense *);
|
void dense_encode (char *, char *, mod2dense *, mod2dense *);
|
||||||
void mixed_encode (char *, char *, mod2dense *, mod2dense *);
|
void mixed_encode (char *, char *, mod2dense *, mod2dense *);
|
||||||
|
void ldpc_encode_ (char *, char *);
|
||||||
|
@ -198,3 +198,20 @@ garbled:
|
|||||||
fprintf(stderr,"Garbled generator matrix in file %s\n",gen_file);
|
fprintf(stderr,"Garbled generator matrix in file %s\n",gen_file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fortran interface routine
|
||||||
|
void init_ldpc_ ( )
|
||||||
|
{
|
||||||
|
char *pchk_file,*gen_file;
|
||||||
|
pchk_file="./jtmode_codes/ldpc-128-82-sf11.pchk";
|
||||||
|
gen_file="./jtmode_codes/ldpc-128-82-sf11.gen";
|
||||||
|
|
||||||
|
printf("pchk_file %s\n",pchk_file);
|
||||||
|
printf("gen_file %s\n",gen_file);
|
||||||
|
|
||||||
|
read_pchk( pchk_file );
|
||||||
|
read_gen( gen_file, 0, 0 );
|
||||||
|
|
||||||
|
printf("N %d M %d\n",N,M);
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user